1 / 12

Matlab Tutorials

Matlab Tutorials. 10 / 04 / 2006. Introduction to Matlab Working with Matlab Image Processing using Matlab Class Project. Introduction. MatLab : Mat rix Lab oratory Numerical Computations with matrices Every number can be represented as matrix Why Matlab? User Friendly (GUI)

creola
Download Presentation

Matlab Tutorials

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Matlab Tutorials 10 / 04 / 2006

  2. Introduction to Matlab • Working with Matlab • Image Processing using Matlab • Class Project

  3. Introduction • MatLab : Matrix Laboratory • Numerical Computations with matrices • Every number can be represented as matrix • Why Matlab? • User Friendly (GUI) • Easy to work with • Powerful tools for complex mathematics

  4. Workspace Command Window Command History Fig: Snap shot of matlab

  5. Matrices in Matlab • To enter a matrix 3 1 6 4 >> A = [3 1 ; 6 4] >> A = [3, 1 ; 6, 4] >> B = [3, 5 ; 0, 2] Examples during Matlab demo

  6. Basic Mathematical Operations Addition: >> C = A + B Subtraction: >> D = A – B Multiplication: >> E = A * B (Matrix multiplication) >> E = A .* B (Element wise multiplication) Division: Left Division and Right Division >> F = A . / B (Element wise division) >> F = A / B (A * inverse of B) >> F = A . \ B (Element wise division) >> F = A \ B (inverse of A * B) Examples during Matlab demo

  7. Generating basic matrices Matrix with ZEROS: >> Z = ZEROS (r, c) Matrix with ONES: >> O = ONES (r, c) IDENTITY Matrix: >> I = EYE (r, c) r  Rows c  Columns zeros, ones, eye  Matlab functions Examples during Matlab demo

  8. Making the best from Matlab • Need help ? • HELP <function name> • LOOKFOR <key word> • Case sensitive • M files (.m) • To write and save matlab commands • Save time and easy to debug • Use of semicolon (;) • Comments (%) • Documentation • www.mathworks.com Examples during Matlab demo

  9. Image processing and matlab • Easy to work with; as Images are matrices • Built in functions for complex operations and algorithms (Ex. FFT, DCT, etc…) • Image processing tool box (?) • Supports most image formats (.bmp, .jpg, .gif, .tiff etc…) Examples during Matlab demo

  10. Image processing in matlab To read and display images • im = imread(“filename.fmt”) • im is r x c if gray scale • im is r x c x 3 if color image (RGB) • imshow(im) % displays image • imwrite(im, “filename.fmt”)% writes image Size of image • [r c] = size(im) Examples during Matlab demo

  11. Working with complex numbers • real and imaginary • real% real part of complex number • imag% imaginary part of complex number • magnitude and phase • abs% magnitude of complex number • angle% phase of complex number Examples during Matlab demo

  12. Plotting / displaying • PLOT(x,y) • Plots y versus x. • Linear plot • XLABEL(‘label’) • YLABEL(‘label’) • TITLE(‘title’) • IMAGE(x) • Displays image 3D plots: • MESH • 3D mesh surface (Ex. filters) • MESHGRID • Useful in 3D plots • SURF • 3D colored surface (Ex. filters) Examples during Matlab demo

More Related