Intro Matlab
Intro Matlab
edu/courses/electrical-engineering-and-computer-
science/6-094-introduction-to-matlab-january-iap-2010/lecture-notes/
http://www.mathworks.com/help/matlab/index.html#mathematics
The name MATLAB stands for MATrix LABoratory. MATLAB was
written originally
to provide easy access to matrix software developed by the LINPACK
(linear system package)
and EISPACK (Eigen system package) projects (Houcque, 2005)
Layout
The desktop includes these panels:
Current Folder Access your files.
Command Window Enter commands at the command line, indicated by the prompt (>>).
Workspace Explore data that you create or import from files.
Command History
Note
Good house keeping
MatLab have one of the best documentations
Doc, help, lookfor edit
help command searches for an exact function name match
lookfor command searches the quick summary information in each function for a match
doc function opens the on-line version of the help manual.
Managing the workspace and command window: who, clear, clc
keep track of everything done during a MATLAB session with the diary command.
>> diary
To continue a line, type ...
Always write comments for your code
Running code step by step
To perform element-wise multiplication rather than matrix multiplication, use the .* operator
Variable
Script
Function
MatLab
Simulink
Mupad
Import
Read
Examples
1/(2+3^2)+4/5*6/7 versus 1/2+3^2+4/5*6/7
floating point number
MATLAB by default displays only 4 decimals
doc format
starts at 0,
takes steps (or increments) of,
stops when * is reached.
xlabel('x = 0:2\pi')
>> ylabel('Sine of x')
>> title('Plot of the Sine function'
Houcque, D. (2005). Introduction to MatLab for Engineering Students. Michigan: Northwestern
University.