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 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 in the Symbolic Toolbox. Make sure that you typed syms x before the function’ definition. Substitute with  using subs command. Do not forget to type syms t before substitution.