| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink Control Design |
| Contents | Index |
| Learn more about Simulink Control Design |
Plot time-domain simulation of nonlinear and linear models
frest.simCompare(simout,sys,input)
frest.simCompare(simout,sys,input,x0)
frest.simCompare(simout,sys,input) plots both
Simulation output, simout, of the nonlinear Simulink model
You obtain the output from the frestimate command.
Simulation output of the linear model sys for the input signal input
The linear simulation results are offset by the initial output values in the simout data.
frest.simCompare(simout,sys,input,x0) plots the frequency response simulation output and the simulation output of the linear model with initial state x0. Because you specify the initial state, the linear simulation result is not offset by the initial output values in the simout data.
Compare a time-domain simulation of the Simulink watertank model and its linear model representation:
% Create input signal for simulation
input = frest.createStep('FinalTime',100);
% Open the Simulink model
watertank
% Specify the operating point for the estimation
watertank_spec = operspec('watertank');
op = findop('watertank',watertank_spec)
% Specify portion of model to estimate
io(1)=linio('watertank/PID Controller',1,'in');
io(2)=linio('watertank/Water-Tank System',1,'out');
% Estimate the frequency response of the magball model
[sysest,simout] = frestimate('watertank',op,io,input)
sys = linearize('watertank',op,io)
frest.simCompare(simout,sys,input)The software returns the following plot.

![]() | frest.Random | frest.simView | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |