Search code examples
matlabtransfer

Substitute s in transfer function


I need to substitute a value for s in a transfer function. For example:

G(s)= 1/ (s+3)

I need to substitute

s = -2.118 +2.221j

What code should I use for this?

PS: Unfortunately, I only have control system toolbox in MATLAB.


Solution

  • What's wrong with saving m-file with

     function g = transferFun( s )
     g = 1 ./ ( s + 3 )
    

    And then calling the function

     >> transferFun( -2.118 + 2.221*j )