LTI data extraction

5 Ansichten (letzte 30 Tage)
Ryan0101
Ryan0101 am 23 Mär. 2012
Hello,
I have a continuous simulink model with mulitple transfer functions that I put into the LTI toolkit, but I would like to extract the bode plot (Magnitude and phase) into variable names so I can compare it to a discrete version I wrote. Is there a way to extract the data? or should I not use LTI and go about it differently?
Thanks
here is the LTI code I used:
mdl = 'MODEL_Continuous'; % set to file name of simulink model
io = getlinio(mdl) % get i/o signals of mdl
op = operspec(mdl)
op = findop(mdl,op) % calculate model operating point
lin = linearize(mdl,op,io) % compute state space model of lin sys
ltiview(lin)

Akzeptierte Antwort

Jarrod Rivituso
Jarrod Rivituso am 23 Mär. 2012
I believe you can use the bode function for that...
[mag,phase,freqs] = bode(lin)
Also, if you are comparing two systems, you might want to actually specify the frequencies of interest
%Create frequency vector with 100 points between 10^-1 .. 10^2
freqs = logspace(-1,2,100);
%Get bode output at those frequencies
[mag,phase] = bode(lin,freqs)
Hope this helps!
  1 Kommentar
Ryan0101
Ryan0101 am 23 Mär. 2012
yep I totally forgot about plain old bode()
Thanks!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Time and Frequency Domain Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by