1

I am trying to use Matlab to evaluate a continuous transfer function using data I am generating in a .net application. I have created a M file with the following code:

function out = transfer(in)
     s = tf('s')
     H = s^2/(s^2+5*s+6.25)
end

What should the input parameter be, and how to use it with the transfer function H?

Once I know that, I'm guessing I can use the various ways of hitting a matlab function from .net; which shouldn't be too bad once I have the function correct.

4

1 回答 1

1

you have to define H as transfer function as well:

H = tf( [ 1 0 0 ] , [ 1 5 6.25] );

you need to define s = tf('s') just if you want to use it for further calculations.

Then you can calculate the system response of your data t (time) and u (values)

t = 0:0.01:4;
u = sin(10*t);
response = lsim(H,u,t)

If your data doesn't have a fixed time step you could a create a timeseries object first. And use sim instead of lsim.

于 2013-09-26T08:48:44.927 回答