Combining Fractions in Matlab

Thread Starter

TierOne

Joined Feb 5, 2011
16
hi all, is someone kind enough to show me how to combine the following into one fraction in matlab?

example:
y=1/x + 1/x^2 + 1/x^3 + x/(1-x^2)
i need:
y=X1/X2 where X1 and X2 are function of x
 

Georacer

Joined Nov 25, 2009
5,182
Is it for a general purpose fraction or are you interested in Transfer Function transformations? For that purpose there is the zpk(tf) command.

If you are interested in general fractions, you can use "factor(syms)" to collect the terms in the nominator and denominator and then use "expand(syms)" to expand them manually.

Does that cover your needs?
 
Top