Estimate State-Space Model
Estimate state-space model using time or frequency data in the Live Editor
Description
The Estimate State-Space Model task lets you interactively estimate and validate a state-space model using time or frequency data. You can define and vary the model structure and specify optional parameters, such as initial condition handling and search method. The task automatically generates MATLAB® code for your live script. For more information about Live Editor tasks generally, see Add Interactive Tasks to a Live Script.
State-space models are models that use state variables to describe a system by a set of first-order differential or difference equations, rather than by one or more nth-order differential or difference equations. State variables can be reconstructed from the measured input-output data, but are not themselves measured during the experiment.
The state-space model structure is a good choice for quick estimation because, apart from the estimation data, the model requires you to specify only one parameter, the model order. For more information about state-space estimation, see What Are State-Space Models?
The Estimate State-Space Model task is independent of the more general System Identification app. Use the System Identification app when you want to compute and compare estimates for multiple model structures.
To get started, load experiment data that contains input and output data into your MATLAB workspace and then import that data into the task. Then specify a model structure to estimate. The task provides configuration controls and plotted results that help you experiment with different model parameters and compare how well the output of each model you specify fits the input/output measurements.
Open the Task
To add the Estimate State-Space Model task to a live script in the MATLAB Editor:
On the Live Editor tab, select Task > Estimate State-Space Model.
In a code block in your script, type a relevant keyword, such as
state,space, orestimate. SelectEstimate State Space Modelfrom the suggested command completions.












