User Tools

Site Tools


gibson:teaching:fall-2012:math445:repertoire

Matlab commands and syntax that you should know

Asterisks mark topics that have not yet been covered in lecture.

   compact scientific notation (e.g. 1.4e-06)
   complex numbers (e.g. 3 + 4*i)
  *Inf, NaN

   =           assignment
   - + * / ^   algebraic operations
   \           solve system of equations Ax=b  (x = A\b)

  *commas and semicolons
  *how to write a row vector
  *how to write a col vector
  *how to write a matrix
  *how to write a complex number
  
  *elementwise operations on vectors, matrices
    - + .* ./ .^
 
  conditional expressions (boolean algebra)
    ==
    ~=
    >
    <
    >=
    <=
    ~
   *&&
   *||
   *& 
   *|
    zero    == false    
    nonzero == true

  control flow 
    for-end
    if-elseif-else-end
    while-end
   *switch

    continue 
    break
    pause

  constructing matrices and vectors
   *zeros
   *ones
   *eye
   *rand
   *randi
   *randn
   linspace
   colon syntax

  hugely helpful miscellaneous functions
    ceil
    floor 
    round
   *size
   *input
   *disp
   *fprintf (%c, %s, %d, %f, \n)
   *save
   *load

  plotting functions
    plot
    semilogy
    semilogx
    loglog
   *hist
    xlabel
    ylabel
    title 
    legend
   *axes
   *hold 
   *clf
   *grid
   *color & marker codes
   *figure

   *scripts

  user-defined functions
     function name, filename
     arguments
     outputs 
     syntax for using a function as an argument to another function
gibson/teaching/fall-2012/math445/repertoire.txt · Last modified: 2012/09/24 20:56 by gibson