Graphics Programs Reference
In-Depth Information
sim
Runs a SIMULINK model.
sim('model')
simple
Attempts to simplify an expression using multiple methods.
syms x y;[expression, how] = simple(sin(x)*cos(y) + cos(x)*sin(y))
simplify
Attempts to simplify an expression symbolically.
syms x; simplify(1/(1 + x)ˆ2 - 1/(1 - x)ˆ2)
simulink
Opens the SIMULINK library.
size
Returns the number of rows and the number of columns in a matrix.
A=[132;415]
[r, c] = size(A)
solve
Solves an equation or set of equations. If the right-hand side of the equation
is omitted, '0' is assumed.
solve('2*xˆ2 - 3*x + 6')
[x, y] = solve('x + 3*y = 4', '-x - 5*y = 3', 'x', 'y')
sound
Plays a vector through the computer speakers.
sound(sin(0:0.1*pi:1000*pi))
strcat
Concatenates two or more strings.
strcat('This ', 'is ', 'a ', 'long ', 'string.')
str2num
Converts a string to a number. Useful in programming.
constant = 'a7'
index = str2num(constant(2))
subs
Substitutes for parts of an expression.
subs('xˆ3 - 4*x + 1', 'x', 2)
subs('sin(x)ˆ2 + cos(x)', 'sin(x)', 'z')
sum
Sums a vector, or sums the columns of a matrix.
k = 1:10; sum(k)
sym
Creates a symbolic variable or number.
sym pi
x = sym('x')
constant = sym('1/2')
syms
Shortcut for creating symbolic variables. The command
syms x
is
equivalent to
x = sym('x')
.
symsxyz
Search WWH ::
Custom Search