Some Helpful Notes on Matlab

[Getting Help | Debugging | Interesting Commands | Graphics]

A good resource is all the m-files in the book Matlab Guide - Second Edition by Desmond J. Higham and Nicholas J. Higham, Siam, 2005.

Getting Help

help sqrt - simple help on functions
doc sqrt - help in web browser
lookfor sqrt - look for all the functions which have the string sqrt in their help description

Top

Debugging

keyboard - gets out of current execution and waits for keyboard input and then it accepts the following commands
dbup dbdown return dbcont dbquit dbclear
dbstop
which -all
mlint
profile

Top

Interesting commands

s=tf('s'); H = (s+1)/(s^2+3*s+1); bode(H); rlocus(H); nyquist(H); margin(H); help tf;
namelengthmax
class
gallery
reshape
fill
f = @(x) exp(x) -1
bvp4c
dde23
struct
cell arrays are struct indexed by integers
any ismember
find
squeeze
end (last index in an indexing expression)
A(1:n+1:end) to refer to all the diagonal elements of an n x n array

Top

Graphics

doc text_propos (to see what TeX notation is supported)
options = ('Interpreter','latex','FontSize','18')
ylabel('$\|x\|_p$',options{:},'HorizontalAlignment','right')
plot(1:10,'o-')
h=findobj
get(h,'type')
set(h(3))
set(h(4),'Marker')
get is a counterpart of set
gca gcf gco
getframe movie

Top


Home
Himanshu Pota <pota@adfa.edu.au>
Last modified: Wednesday August 31, 2005 10:55 AM