matlabsumtransfer-function

Matlab Adding two transfer functions


I'm trying to add two transfer functions together, for example:

tf1=tf(1,[1 0]);  
tf2=tf(2,[1 0]);  
tsum=tf1+tf2

MATLAB considers tf1 and tf2 as blocks connected in series and therefore multiplies tf1 and tf2 together, the result is:

tsum =

3 s
---
s^2

Continuous-time transfer function.

how can I get MATLAB to return the sum of tf1 and tf2 ? so the transfer function that i'm looking for is:

3
-
s

Solution

  • EDU>> minreal(tsum)
    
    ans =
    
      3
      -
      s
    
    Continuous-time transfer function.
    

    see

    http://www.mathworks.com/help/control/ref/minreal.html