Graphics Programs Reference
In-Depth Information
num2str
Converts a number to a string. Useful in programming.
constant = ['a' num2str(1)]
ode45
Numerical ODE solver for first-order equations. See MATLAB's online help
for
ode45
for a list of other MATLAB ODE solvers.
f = inline('tˆ2 + y', 't', 'y')
[x, y] = ode45(f, [0 10], 1);
plot(x, y)
ones
Creates a matrix of ones.
ones(3)
ones(3, 1)
open
Opens a file. The way this is done depends on the filename extension.
open myfigure.fig
path
Without an argument, displays the search path. With an argument, sets the
searchpath. Type
help path
for details.
pretty
Displays a symbolic expression in a more readable format.
syms x y; expr = x/(x - 3)/(x + 2/y)
pretty(expr)
prod
Computes the product of the entries of a vector.
X=[351-623-56100]; prod(X)
pwd
Shows the name of the current (working) directory.
quadl
Numerical integration command. In MATLAB 5.3 or earlier, use
quad8
in-
stead.
format long; quadl('sin(exp(x))', 0, 1)
g = inline('sin(exp(x))'); quad8(g, 0, 1)
quit
Terminates a MATLAB session.
rand
Random number generator; gives a random number between 0 and 1.
rank
Gives the rank of a matrix.
A = [2 3 5; 4 6 8]; rank(A)
roots
Finds the roots of a polynomial whose coefficients are given by the elements
of the vector argument of
roots
.
roots([1 2 2])
round
Rounds a number to the nearest integer.
save
Saves Workspace variables to a specified file. See also
diary
and
load
.
save filename
Search WWH ::
Custom Search