|
|
|
If you are using the Student Version of MATLAB, then you have access to the optional Symbolic Math Toolbox. If you are using a professional (non-student) version, then you must purchase this toolbox separately. If you do not know whether your version of MATLAB is equipped with the toolbox or not, try a few of the following exercises. If they work, you’ve got it. If not, you will have to skip over any exercise that asks you to perform computations with variables that have not been assigned numeric values and should be treated as symbols.
MATLAB’s Symbolic Math Toolbox
uses Maple, a powerful computer algebra system, to manipulate and solve symbolic
expressions.
syms x  % x is a symbolic variable
f = 3*x^2 - 5*x + 1 % sym expression
g = x^2 + 2*x % so is g
f + g
x = 5 % x has a numeric value
f
= 3*x^2 - 5*x + 1
syms x
f = 3*x^2 - 5*x + 1
ezplot(f, [- 3,2])
subs(f, x, - 2)
syms q
subs(f, x, q)
syms a b c t % Create symbolics
g = a*t^2 + b*t + c
solve(g, t) % Solve g = 0 for t
|
|
|
modules at math.duke.edu | Copyright CCP and the author(s), 2000 |