Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction MATLAB stands for MATrix LABoratory.  Basics  Matrix Manipulations  MATLAB Programming  Graphics  Image types  Image Processing  Useful.

Similar presentations


Presentation on theme: "Introduction MATLAB stands for MATrix LABoratory.  Basics  Matrix Manipulations  MATLAB Programming  Graphics  Image types  Image Processing  Useful."— Presentation transcript:

1 Introduction MATLAB stands for MATrix LABoratory.  Basics  Matrix Manipulations  MATLAB Programming  Graphics  Image types  Image Processing  Useful functions

2 Basics  Basic data element is an array that does not require dimensioning.  A=[1 2 3;4 5 6; 7 8 9] A = [ 1 2 3 4 5 6 4 5 6 7 8 9] 7 8 9]

3 Matrix Manipulations  Sum(A) = sums of the columns of A  A’ = Transpose of A  Diag(A) = gives diagonal elements of A  Min(A) = minimum element column wise of A.  Max(A) = maximum element column wise of A.  Mean(A) = Average element column wise of A.  Std(A) = Standard deviation column wise of A.  X = zeros(5,5)Y = ones(6,6)  M=rand(5,5)N = randn(6,6)  A=[1:50]  A=[0:pi/4:pi]=[0 0.7854 1.5708 2.3562 3.1416]

4 Matrix Manipulations (contd..)  B = magic(4) = [ 16 2 3 13 Dürer's magic square 5 11 10 8 9 7 6 12 9 7 6 12 4 14 15 1] 4 14 15 1]  All numbers are stored internally using the long format specified by the IEEE floating-point standard.  Floating-point numbers have finite precision  16 significant decimal digits and finite precision  16 significant decimal digits and finite range  10 -308 to 10 +308. finite range  10 -308 to 10 +308.

5 Matrix Manipulations (contd..)  A(:,2) = []  deletes 2 nd column.  A(2:2:12) = [] results in row vector of remaining elements.  A = A.*5  Element-by-element multiplication.  [indices] = find(isprime(A))  format  this command can be used for formatting the displayed numeric output (either in short or long format).

6 MATLAB Programming MATLAB has several flow control constructs:  if statements  switch statements  for loops  while loops  continue statements  break statements

7 Graphics  Plotting sinusoidal function using the plot function.  Cylinder  unit cylinder with default 20 points on the circumference.  Sphere  unit sphere with default 20 points on the circumference.  Subplot(m,n,p)  partitions the figure window into m-by-n matrix of small subplots and selects the p th subplot for the current plot.

8 Graphics (contd..)  mesh  produces wire frame surfaces that color only the lines connecting the defining points.  surf  displays both the connecting lines and the faces of the surface in color.  Light and camera effect on the visualization of 2-dim sinc function (i.e. sin(r)/r) between x and y directions.

9 Types of Images  Index images  Intensity images  Binary images  RGB images

10 Image Processing  Dürer's magic square  Animation using EraseMode property.  Animation using Movie method  Functions: Imread  read an image Imread  read an image Imwrite  writes specified matrix into an image. Imwrite  writes specified matrix into an image. Image  displays specified matrix as an image. Image  displays specified matrix as an image. Imshow  Displays an intensity (gray level) image. Imshow  Displays an intensity (gray level) image. Im2frame  converts an image into movie frame. Im2frame  converts an image into movie frame. Avifile  creates an avifile object. Avifile  creates an avifile object. Addframe  adds movie frame to avifile object. Addframe  adds movie frame to avifile object. Getframe  returns movie frame. Getframe  returns movie frame. Movie  Play recorded movie frames. Movie  Play recorded movie frames. close  closes current figure. close  closes current figure.

11 Useful functions  help fnName  help on any function.  whos  information on current variables in the workspace.  guide  GUI editor.  demo  Matlab toolboxes and functions demo.  eval(str)  evaluates expression in the str variable.  load abc.mat  loads data in the matlab file.


Download ppt "Introduction MATLAB stands for MATrix LABoratory.  Basics  Matrix Manipulations  MATLAB Programming  Graphics  Image types  Image Processing  Useful."

Similar presentations


Ads by Google