Professional Documents
Culture Documents
Defining/changing variables:
x
x
x
x
A
=
=
=
=
=
3
define variable x to be 3
[1 2 3] set x to the 13 row-vector (1,2,3)
[1 2 3]; same, but don't echo x to output
[1;2;3] set x to the 31 column-vector (1,2,3)
[1 2 3 4;5 6 7 8;9 10 11 12];
Plotting:
plot(y)
plot y as the y axis, with 1,2,3, as the x axis
plot(x,y)
plot y versus x (must have same length)
plot(x,A)
plot columns of A versus x (must have same # rows)
loglog(x,y) plot y versus x on a log-log scale
semilogx(x,y)
plot y versus x with x on a log scale
semilogy(x,y)
plot y versus x with y on a log scale
fplot(@(x) expression,[a,b])