forkandwait
forkandwait

Reputation: 5157

How to combine fractions using octave symbolic?

Does anyone know how to get Octave to combine fractions in the symbolic package? For example, I would like to make "1+1/s" rewritten as "(s^2 + 1)/s".

My reason is that I want to get zeros and poles of frequency domain expressions into the right place in the rational expression. The above is a very simple example of a more complicated use case, typically with lots of R, L, C constants.

Upvotes: 0

Views: 709

Answers (1)

obchardon
obchardon

Reputation: 10792

You can use the function factor(), in this case it will simply put the whole expression with the same common denominator:

syms x,s

x = 1+1/s
res = factor(x)

and

res =   
s + 1
─────
  s  

Upvotes: 1

Related Questions