1 / 13

Matlab Tutorial

Matlab Tutorial. Iman Moazzen First Session – September 11, 2013. Matlab (Matrix Laboratory). It allows you to solve many technical computing problems, especially those with vector or matrix formulation. Identifiers. Variables or function names Remarks:

diazjohn
Télécharger la présentation

Matlab Tutorial

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 Tutorial Iman Moazzen First Session – September 11, 2013

  2. Matlab (Matrix Laboratory) • It allows you to solve many technical computing problems, especially those with vector or matrix formulation.

  3. Identifiers • Variables or function names Remarks: 1- It can include letters, digits, underline 2- The first character must be a letter e.g.: 3iman iman@3 iman613 iman$$ Iman613 iman_3 pi i j

  4. Matlab (Matrix laboratory) • Single value a=1 • Vector row vector: a=[1 2,3] column vector a=[1;2;3] • Matrix a=[1 2 3;4 5 6;7 8 9]

  5. a=[1 4 6 7; 5 2 0 9; 8 8 3 2; 7 6 5 1] a(1,3)  6 a(1,:)  [1 4 6 7] a(:,2)  [4;2;8;6] a(1:3,2:3)  [4 6;2 0;8 3] 2D index: a(row,column) 1D index: a(index) start:step:end e.g: 1:2:5  [1 3 5]

  6. 1D index • a(1,2) • a(6)  2 • a(1:2:end)  [1 8 4 8 6 3 7 2]

  7. Special Matrix • eye  eye(3,3)  • ones  ones(1,3)  [1 1 1] • zeros  zeros(1,4)  [0 0 0 0] • rand  rand(1,2)  [0.37 0.86] • linspace  linspace(1,3,5)  [1 1.5 2 2.5 3]

  8. Basic Fucntion • + - * / ^ abs angle imag real conj round floor ceil mod min max sum prod cart2pol pol2cart syms subs exp log log10 log2 sqrt sin cos tan asin acos atan help

  9. Use M.File to create Matlab code intead of command window • file  new  M.file

  10. Conditional Statements • if-elesif-else • while • switch

  11. Function • function [out1,out2,…]=functionname(input1,input2,…) Note: function can not be run directly, you need to call it .

  12. Graphing • plot • color • style • Label

More Related