Manipulation of expressions

First perform the command
>> syms a b c d x y
Several manipulations of symbolic expression can be performed, stated in Table 3.3.

Table 3.3: Manipulation of expressions
Matlab Meaning of the command
expand((a+b)^3) Get rid of the brackets.
factor(a^3+3*a^2*b+3*a*b^2+b^3) Factorise.
[n d] = numden(a/b+c/d) Reduce to a common denominator.
simplify((x\^2+2*x+1)/(x+1)) Simplify the expression.

If you want to write the expression ` $ x/(1+x/(1+x))$ ' as a numerator divided by a denominator, you can proceed as follows:
>> syms x
>> y = x/(1+x/(1+x));
>> [n d] = numden(y)

n =
d =
The numerator and denominator cannot be simplified further.

Previous      Next      Up      Contents

Esteur 2010-03-22