Introduction Matlab
Introduction Matlab
The MATLAB working environment : The set of tools and facilities that you
work with as the MATLAB user or programmer, including tools for
developing, managing, debugging, and profiling
Symbols in MATLAB
>> Prmpt
... Continue statement on next line
, Separate statements and data
% Start comment which ends at end of line
; (1) suppress output (2) used as a row separator in a matrix
: specify range
Syntax
1) snew = subs(s,old,new)
2) subs(function, [oldvar1,oldvar2..], (newvar,newvar2..))
PLOTTING:-
MATLAB will plot one vector vs. another. The first one will be treated as the
abscissa (or x) vector and the second as the ordinate (or y) vector. The vectors
have to be the same length.
MATLAB will also plot a vector vs. its own index. The index will be treated as the
abscissa vector.There are commands in MATLAB to "annotate" a plot to put on
axis labels, titles, and legends. For example:
To put a label on the axes we would use:
>> xlabel ('X-axis label')
>> ylabel ('Y-axis label')
To put a title on the plot, we would use:
>> title ('Title of the plot’)
To distinct between function in the graph use:
>> legend(legend_1, legend_2)