How to generate model output given a transfer function and input signal

5 Ansichten (letzte 30 Tage)
Hello all,
I have used the systemIdentification toolbox to generate a transfer function from u to y as:
0.002879 s + 2.306e-05
s^2 + 0.003373 s + 0.0002227
Checking the box "Output model" gives an output y given the input vector as:
My question is how can I generate this output in code?
Thank you in advance!

Akzeptierte Antwort

Star Strider
Star Strider am 21 Feb. 2023
If you have the time vector and the matching input vector, use the lsim function to generate the output, however a more robust approach would be to use the compare function, specifically as described in Obtain Initial Conditions.
  2 Kommentare
Star Strider
Star Strider am 26 Feb. 2023
My guess is that you are missing the initial conditions vector. This is one reason that using state space representation is preferable to other representations, especially since the ssest function will return the initial conditions if you request it. See the documentation section on Estimate Initial States as Independent Parameters for details.
The compare function incorporates it automatically if requested, the reason I suggested it.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov am 20 Feb. 2023
use tfestimate() - here is documentation how to use it:


Find more on Linear Model Identification in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by