Practical 7: Symbolic Toolbox

Practical 7

Algebraic Transformation

The Symbolic Toolbox allows algebraic transformation of a function using the subs command

> Exercise: Variables’ substitution

> Type the following commands, where function f is the same as in the previous example.

syms t

y2=subs(f,x,t)     %substitutes x with t

y3=subs(f,x,t-1)    %substitutes x with t-1

y3=simple(y3)       %to simplify the expression for y3

> Exercise: subs Command

> Define function f(x)=x^{4}-5x^{2}+4 in the Symbolic Toolbox. Make sure that you typed syms x before the function’ definition. Substitute x with  \sqrt{t}  using subs command. Do not forget to type syms t before substitution.