Practical 7: Symbolic Toolbox

Practical 7

Toolbox Functions

sym(‘x’) or syms x Creates a symbolic variable x
sym(1/4) Creates symbolic number 1/4
double(1/4) Converts symbolic number 1/4 to standard 0.25
subs(f,x,a) Substitutes a variable x in f(x) with value a and finds f(x)

x=a

eval(f)

Finds value of f(x) at a by assigning a to x first.
ezplot(f,a,b) Plots the symbolic function f(x) over the interval [a,b]
pretty Formats output to look like type-set mathematics
simplify Performs algebraic and other function simplifications
simple Tries a number of simplification techniques including trigonometric identities. Running this command twice can further simplify complex expression.
collect Collects like terms
factor Attempts to factor the expression
expand Expands all terms
poly2sym Converts an array of polynomial coefficients into a symbolic expression with x as the variable
sym2poly Converts symbolic polynomial into its coefficient array
diff(f,x) Finds 1st derivative of f(x) with respect to x
diff(f,x,n) Finds nth derivative of f(x) with respect to x
int(f,x) Indefinite integral of f(x)
int(f,x,a,b)

Definite integral of f(x) with endpoints a , b