SlideShare uma empresa Scribd logo
1 de 19
Created by :- Master Team
Outline
 What is MATLAB.
 MATLAB Interface
 MATLAB as programming language.
 Arrays in MATLAB.
 Basic operations.
 Some Built-in functions.
 Loops and Conditions.
 Graphics in MATLAB.
 Image in MATLAB
 MATLAB Help
What is MATLAB
 High –level, data structured, technical computing
  programming language.
 Stands for Matrix Laboratory.
 The basic data type is the Array (every thing is a matrix)
          Scale n=1 is 1 x 1 array.
          Vector a = [1 2 3] is 1 x 3 array (1-Dim).
          Matrix A = [1 2 3 ; 4 5 6] is 2 x 3 array (2-Dim).
 Used in linear algebra, graphic, image, simulation,.. Etc
MATLAB Interface
MATLAB Interface
 Menu bar.
 Tool bar.
 Command window.
 Command History.
 Current directory.
 Workspace.
MATLAB as programming language
 Like any other programming language MATLAB
 contains variables , functions , loops , conditions ,,,
 And so on.

 As any other programming language , MATLAB can call
 function of another language , and Also MATLAB ’s
 functions can be called by any language.
Arrays in MATLAB
 >> A = [1 2 3]
      output is A = 1 2 3
 >> A = [1 2 3];
      output is   null

       ( ; ) means execute without displaying output
Arrays in MATLAB
 Matrix is 2-D array.
 Vector is special case of matrix
  -Vertical vector is m x 1 matrix   - Horizontal vector is 1 x n matrix
    >> A = [1; 2; 3]       A= 1        >> A = [1 2 3] A = 1 2        3
                               2
                               3
 Scale number is special case of vector
   -scale is 1 x 1 vector
   >>B = 5
Basic operations
 ^: exponentiation
 *: multiplication
 /: division
 : left division. The operation AB is effectively the same    as
    INV(A)*B, although left division is calculated differently and is
    much quicker.
 +: addition
 -: subtraction
Some Built-in functions
zeros(m,n)        ones(m,n)       eye(n)

>>a=zeros(2,3)   >> a=ones(3,2)   >> eye(2)
a=0 0 0            a=1 1          a= 1 0
   0 0 0              1 1             0 1
                      1 1
Some Built-in functions
   rand (m,n)                     magic (m)
   mean (A)                       median (A)
   min (A)                        max (A)
   sum (A)                        sort (A)
   dot (a,b)                      cross (a,b)
   inv (A)                        length (A)
   disp (A)                       load (A)

     For more functions back to MATLABE Help
Loops and Conditions
 >>for i = 1:2   >> for I = 5:-2:1, I, end
      i
     end

Output                Output
     I=1                 I=5
     I=2                 I=3
     I=3                 I=1
Loops and Conditions
 >> n=3;          >>n=0;
     while n > 0     done = 0;
     n=n-1           while ~done
     end                n = n+1
                        if n >= 3, done = 1; end
                      end
Output               Output
  n= 2                 n= 1
  n= 1                 n= 2
  n= 0                 n= 3
Loops and Conditions
>> n = 3;
   if n > 0                         output
        disp('Positive value.')
   elseif n < 0                   Positive value
        disp('Negative value.')
   else
        disp('Zero.')
   end
Graphics in MATLAB
 As soon as graphs can represented by vectors, can be
 manipulated by MATLAB like a normal vectors

 >> x = [1 2 3 4];
 >> y = [2 4 6 8];
 >>title('Figure 1');
 >>plot(x,y);
Image in MATLAB
 As soon as images can represented by matrices, can be
    manipulated by MATLAB like any other matrix.
   >> x = imreade(' kids.tif ');
   >>[x map] = imreade(' kids.tif ');
   >>imshow(x);
   >>imshow(x , map);
   >>imwrite(x , ' c:img.png ' , 'png');
Image in MATLAB
 To convert between different image types:-
    x=imread(‘cameraman.png’);
    Y=gray2rgb(x);
    Y=rgb2gray(x);
    Y=rgb2ind(x);
    Y=ind2rgb(x);
    Y=ind2gray(x);
    Y=gray2ind(x);
Image in MATLAB
 To rotate an image :-
    X=imread(‘cameraman.png’);
    y=imrotate(x,65,0);
                         degree of rotation
MATLAB Help
 For more functions, liberaries and any other
  information you can get it from MATLAB help
 Getting the help :-
   >>Desktop >> help.
   >>Help >> Product help.
   F1.

Mais conteúdo relacionado

Mais procurados (19)

INTRODUCTION TO MATLAB session with notes
  INTRODUCTION TO MATLAB   session with  notes  INTRODUCTION TO MATLAB   session with  notes
INTRODUCTION TO MATLAB session with notes
 
Matlab ch1 intro
Matlab ch1 introMatlab ch1 intro
Matlab ch1 intro
 
MATLAB for Technical Computing
MATLAB for Technical ComputingMATLAB for Technical Computing
MATLAB for Technical Computing
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 
Mbd2
Mbd2Mbd2
Mbd2
 
Network security CS6
Network security   CS6Network security   CS6
Network security CS6
 
Matlab practice
Matlab practiceMatlab practice
Matlab practice
 
matlab
matlabmatlab
matlab
 
Lecture three
Lecture threeLecture three
Lecture three
 
Matlab cheatsheet
Matlab cheatsheetMatlab cheatsheet
Matlab cheatsheet
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arrays
 
Lectue five
Lectue fiveLectue five
Lectue five
 
Matlab lec1
Matlab lec1Matlab lec1
Matlab lec1
 
MATLAB - Arrays and Matrices
MATLAB - Arrays and MatricesMATLAB - Arrays and Matrices
MATLAB - Arrays and Matrices
 
Basic of octave matlab programming language
Basic of octave matlab programming languageBasic of octave matlab programming language
Basic of octave matlab programming language
 
Octave - Prototyping Machine Learning Algorithms
Octave - Prototyping Machine Learning AlgorithmsOctave - Prototyping Machine Learning Algorithms
Octave - Prototyping Machine Learning Algorithms
 
Control System Homework Help
Control System Homework HelpControl System Homework Help
Control System Homework Help
 
Mechanical Engineering Homework Help
Mechanical Engineering Homework HelpMechanical Engineering Homework Help
Mechanical Engineering Homework Help
 

Destaque

Matlab intro
Matlab introMatlab intro
Matlab introfvijayami
 
Summer training in matlab
Summer training in matlabSummer training in matlab
Summer training in matlabArshit Rai
 
Automated histopathological image analysis: a review on ROI extraction
Automated histopathological image analysis: a review on ROI extractionAutomated histopathological image analysis: a review on ROI extraction
Automated histopathological image analysis: a review on ROI extractioniosrjce
 
Matlab for diploma students(1)
Matlab for diploma students(1)Matlab for diploma students(1)
Matlab for diploma students(1)Retheesh Raj
 
Android - Displaying images
Android - Displaying imagesAndroid - Displaying images
Android - Displaying imagesMatteo Bonifazi
 
Digital image processing using matlab (fundamentals)
Digital image processing using matlab (fundamentals)Digital image processing using matlab (fundamentals)
Digital image processing using matlab (fundamentals)Taimur Adil
 
Az ve Öz Matlab - Muhammet ÇAĞATAY
Az ve Öz Matlab - Muhammet ÇAĞATAYAz ve Öz Matlab - Muhammet ÇAĞATAY
Az ve Öz Matlab - Muhammet ÇAĞATAYMuhammet ÇAĞATAY
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods thanhhoang2012
 
Introduction to Image Processing with MATLAB
Introduction to Image Processing with MATLABIntroduction to Image Processing with MATLAB
Introduction to Image Processing with MATLABSriram Emarose
 
Extraction of region of interest in an image
Extraction of region of interest in an imageExtraction of region of interest in an image
Extraction of region of interest in an imageHarsukh Chandak
 
Cours 1 bases de matlab 2eme annees
Cours 1   bases de matlab 2eme anneesCours 1   bases de matlab 2eme annees
Cours 1 bases de matlab 2eme anneesTarik Taleb Bendiab
 
Matlab Working With Images
Matlab Working With ImagesMatlab Working With Images
Matlab Working With Imagesmatlab Content
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processingAnuj Arora
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIPbabak danyal
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersMurshida ck
 

Destaque (20)

Matlab
MatlabMatlab
Matlab
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
Summer training in matlab
Summer training in matlabSummer training in matlab
Summer training in matlab
 
Automated histopathological image analysis: a review on ROI extraction
Automated histopathological image analysis: a review on ROI extractionAutomated histopathological image analysis: a review on ROI extraction
Automated histopathological image analysis: a review on ROI extraction
 
Matlab for diploma students(1)
Matlab for diploma students(1)Matlab for diploma students(1)
Matlab for diploma students(1)
 
Android - Displaying images
Android - Displaying imagesAndroid - Displaying images
Android - Displaying images
 
Digital image processing using matlab (fundamentals)
Digital image processing using matlab (fundamentals)Digital image processing using matlab (fundamentals)
Digital image processing using matlab (fundamentals)
 
Image Processing Using MATLAB
Image Processing Using MATLABImage Processing Using MATLAB
Image Processing Using MATLAB
 
Spatial domain and filtering
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
 
Az ve Öz Matlab - Muhammet ÇAĞATAY
Az ve Öz Matlab - Muhammet ÇAĞATAYAz ve Öz Matlab - Muhammet ÇAĞATAY
Az ve Öz Matlab - Muhammet ÇAĞATAY
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods
 
Introduction to Image Processing with MATLAB
Introduction to Image Processing with MATLABIntroduction to Image Processing with MATLAB
Introduction to Image Processing with MATLAB
 
IMAGE PROCESSING
IMAGE PROCESSINGIMAGE PROCESSING
IMAGE PROCESSING
 
Extraction of region of interest in an image
Extraction of region of interest in an imageExtraction of region of interest in an image
Extraction of region of interest in an image
 
Cours 1 bases de matlab 2eme annees
Cours 1   bases de matlab 2eme anneesCours 1   bases de matlab 2eme annees
Cours 1 bases de matlab 2eme annees
 
Matlab Working With Images
Matlab Working With ImagesMatlab Working With Images
Matlab Working With Images
 
Region Of Interest Extraction
Region Of Interest ExtractionRegion Of Interest Extraction
Region Of Interest Extraction
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processing
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIP
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginners
 

Semelhante a Intro to matlab

MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.pptkebeAman
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxDevaraj Chilakala
 
Intro matlab and convolution islam
Intro matlab and convolution islamIntro matlab and convolution islam
Intro matlab and convolution islamIslam Alabbasy
 
Matlab 1
Matlab 1Matlab 1
Matlab 1asguna
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabBilawalBaloch1
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabDnyanesh Patil
 
Fundamentals of Image Processing & Computer Vision with MATLAB
Fundamentals of Image Processing & Computer Vision with MATLABFundamentals of Image Processing & Computer Vision with MATLAB
Fundamentals of Image Processing & Computer Vision with MATLABAli Ghanbarzadeh
 
Matlab-free course by Mohd Esa
Matlab-free course by Mohd EsaMatlab-free course by Mohd Esa
Matlab-free course by Mohd EsaMohd Esa
 
mat lab introduction and basics to learn
mat lab introduction and basics to learnmat lab introduction and basics to learn
mat lab introduction and basics to learnpavan373
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functionsjoellivz
 
matlab_tutorial.ppt
matlab_tutorial.pptmatlab_tutorial.ppt
matlab_tutorial.pptnaveen_setty
 
matlab_tutorial.ppt
matlab_tutorial.pptmatlab_tutorial.ppt
matlab_tutorial.pptaboma2hawi
 
RedisConf18 - Lower Latency Graph Queries in Cypher with Redis Graph
RedisConf18 - Lower Latency Graph Queries in Cypher with Redis GraphRedisConf18 - Lower Latency Graph Queries in Cypher with Redis Graph
RedisConf18 - Lower Latency Graph Queries in Cypher with Redis GraphRedis Labs
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsMukesh Kumar
 
Dsp manual completed2
Dsp manual completed2Dsp manual completed2
Dsp manual completed2bilawalali74
 

Semelhante a Intro to matlab (20)

MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.ppt
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
 
Intro matlab and convolution islam
Intro matlab and convolution islamIntro matlab and convolution islam
Intro matlab and convolution islam
 
Matlab
MatlabMatlab
Matlab
 
bobok
bobokbobok
bobok
 
Matlab 1
Matlab 1Matlab 1
Matlab 1
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Fundamentals of Image Processing & Computer Vision with MATLAB
Fundamentals of Image Processing & Computer Vision with MATLABFundamentals of Image Processing & Computer Vision with MATLAB
Fundamentals of Image Processing & Computer Vision with MATLAB
 
Matlab1
Matlab1Matlab1
Matlab1
 
Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
 
Matlab-free course by Mohd Esa
Matlab-free course by Mohd EsaMatlab-free course by Mohd Esa
Matlab-free course by Mohd Esa
 
mat lab introduction and basics to learn
mat lab introduction and basics to learnmat lab introduction and basics to learn
mat lab introduction and basics to learn
 
Matlab booklet
Matlab bookletMatlab booklet
Matlab booklet
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
 
matlab_tutorial.ppt
matlab_tutorial.pptmatlab_tutorial.ppt
matlab_tutorial.ppt
 
matlab_tutorial.ppt
matlab_tutorial.pptmatlab_tutorial.ppt
matlab_tutorial.ppt
 
RedisConf18 - Lower Latency Graph Queries in Cypher with Redis Graph
RedisConf18 - Lower Latency Graph Queries in Cypher with Redis GraphRedisConf18 - Lower Latency Graph Queries in Cypher with Redis Graph
RedisConf18 - Lower Latency Graph Queries in Cypher with Redis Graph
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projects
 
Dsp manual completed2
Dsp manual completed2Dsp manual completed2
Dsp manual completed2
 

Intro to matlab

  • 1. Created by :- Master Team
  • 2. Outline  What is MATLAB.  MATLAB Interface  MATLAB as programming language.  Arrays in MATLAB.  Basic operations.  Some Built-in functions.  Loops and Conditions.  Graphics in MATLAB.  Image in MATLAB  MATLAB Help
  • 3. What is MATLAB  High –level, data structured, technical computing programming language.  Stands for Matrix Laboratory.  The basic data type is the Array (every thing is a matrix)  Scale n=1 is 1 x 1 array.  Vector a = [1 2 3] is 1 x 3 array (1-Dim).  Matrix A = [1 2 3 ; 4 5 6] is 2 x 3 array (2-Dim).  Used in linear algebra, graphic, image, simulation,.. Etc
  • 5. MATLAB Interface  Menu bar.  Tool bar.  Command window.  Command History.  Current directory.  Workspace.
  • 6. MATLAB as programming language  Like any other programming language MATLAB contains variables , functions , loops , conditions ,,, And so on.  As any other programming language , MATLAB can call function of another language , and Also MATLAB ’s functions can be called by any language.
  • 7. Arrays in MATLAB  >> A = [1 2 3] output is A = 1 2 3  >> A = [1 2 3]; output is null ( ; ) means execute without displaying output
  • 8. Arrays in MATLAB  Matrix is 2-D array.  Vector is special case of matrix -Vertical vector is m x 1 matrix - Horizontal vector is 1 x n matrix >> A = [1; 2; 3] A= 1 >> A = [1 2 3] A = 1 2 3 2 3  Scale number is special case of vector -scale is 1 x 1 vector >>B = 5
  • 9. Basic operations  ^: exponentiation  *: multiplication  /: division  : left division. The operation AB is effectively the same as INV(A)*B, although left division is calculated differently and is much quicker.  +: addition  -: subtraction
  • 10. Some Built-in functions zeros(m,n) ones(m,n) eye(n) >>a=zeros(2,3) >> a=ones(3,2) >> eye(2) a=0 0 0 a=1 1 a= 1 0 0 0 0 1 1 0 1 1 1
  • 11. Some Built-in functions rand (m,n) magic (m) mean (A) median (A) min (A) max (A) sum (A) sort (A) dot (a,b) cross (a,b) inv (A) length (A) disp (A) load (A) For more functions back to MATLABE Help
  • 12. Loops and Conditions  >>for i = 1:2 >> for I = 5:-2:1, I, end i end Output Output I=1 I=5 I=2 I=3 I=3 I=1
  • 13. Loops and Conditions  >> n=3; >>n=0; while n > 0 done = 0; n=n-1 while ~done end n = n+1 if n >= 3, done = 1; end end Output Output n= 2 n= 1 n= 1 n= 2 n= 0 n= 3
  • 14. Loops and Conditions >> n = 3; if n > 0 output disp('Positive value.') elseif n < 0 Positive value disp('Negative value.') else disp('Zero.') end
  • 15. Graphics in MATLAB  As soon as graphs can represented by vectors, can be manipulated by MATLAB like a normal vectors  >> x = [1 2 3 4]; >> y = [2 4 6 8]; >>title('Figure 1'); >>plot(x,y);
  • 16. Image in MATLAB  As soon as images can represented by matrices, can be manipulated by MATLAB like any other matrix.  >> x = imreade(' kids.tif ');  >>[x map] = imreade(' kids.tif ');  >>imshow(x);  >>imshow(x , map);  >>imwrite(x , ' c:img.png ' , 'png');
  • 17. Image in MATLAB  To convert between different image types:-  x=imread(‘cameraman.png’);  Y=gray2rgb(x);  Y=rgb2gray(x);  Y=rgb2ind(x);  Y=ind2rgb(x);  Y=ind2gray(x);  Y=gray2ind(x);
  • 18. Image in MATLAB  To rotate an image :-  X=imread(‘cameraman.png’);  y=imrotate(x,65,0); degree of rotation
  • 19. MATLAB Help  For more functions, liberaries and any other information you can get it from MATLAB help  Getting the help :-  >>Desktop >> help.  >>Help >> Product help.  F1.