| Simulink® Control Design™ | ![]() |
lin=linearize('sys',io)
lin=linearize('sys',op,io)
lin=linearize('sys',op,io,options)
lin_block=linearize('sys',op,'blockname')
lin=linearize('sys',op)
lin=linearize('sys',op,options)
[lin,op] = linearize('sys',snapshottimes);
lin = linearize('sys','StateOrder',stateorder)
As an alternative to the linearize function, create linearized models using the Linearization Task node of the Simulink Control Design GUI. See Linearizing the Model.
lin=linearize('sys',io) takes a model name, 'sys', and an I/O object, io, as inputs and returns a linear time-invariant state-space model, lin. The operating point object is created with the function operpoint or findop. The linearization I/O object is created with the function getlinio or linio. io must be associated with the Simulink model, sys.
lin=linearize('sys',op,io) takes a model name, 'sys', an operating point object, op, and an I/O object, io, as inputs and returns a linear time-invariant state-space model, lin. The operating point object is created with the function operpoint or findop. The linearization I/O object is created with the function getlinio or linio. Both op and io must be associated with the same Simulink model, sys.
lin=linearize('sys',op,io,options) takes a model name, 'sys', an operating point object, op, an I/O object, io, and a linearization options object, options, as inputs. It returns a linear time-invariant state-space model, lin. The operating point object is created with the function operpoint or findop. The linearization I/O object is created with the function getlinio or linio. Both op and io must be associated with the same Simulink model, sys. The linearization options object is created with the function linoptions and contains several options for linearization.
lin_block=linearize('sys',op,'blockname') takes a model name, 'sys', an operating point object, op, and the name of a block in the model, 'blockname', as inputs and returns lin_block, a linear time-invariant state-space model of the named block. The operating point object is created with the function operpoint or findop. Both op and 'blockname' must be associated with the same Simulink model, sys. You can also supply a fourth argument, options, to provide options for the linearization. Create options with the function linoptions.
lin=linearize('sys',op) creates a linearized model, lin, of the system 'sys' at the operating point, op. Root-level inport and outport blocks in sys are used as inputs and outputs for linearization. The operating point object, op, is created with the function operpoint or findop. You can also supply a third argument, options, to provide options for the linearization. Create options with the function linoptions.
lin=linearize('sys',op,options) is the form of the linearize function that is used with numerical-perturbation linearization. The function returns a linear time-invariant state-space model, lin, of the entire model, sys. The operating point object, op, is created with the function operpoint or findop. The LinearizationAlgorithm option must be set to 'numericalpert' within options for numerical-perturbation linearization to be used. Create the variable options with the linoptions function. The function uses inport and outport blocks in the model as inputs and outputs for linearization.
[lin,op] = linearize('sys',snapshottimes); creates operating points for the linearization by simulating the model, 'sys', and taking snapshots of the system's states and inputs at the times given in the vector snapshottimes. The function returns lin, a set of linear time-invariant state-space models evaluated and op, the set of operating point objects used in the linearization. You can specify input and output points for linearization by providing an additional argument such as a linearization I/O object created with getlinio or linio, or a block name. If an I/O object or block name is not supplied the linearization uses root-level inport and outport blocks in the model. You can also supply an additional argument, options, to provide options for the linearization. Create options with the function linoptions.
lin = linearize('sys','StateOrder',stateorder) takes the Simulink model 'sys' and creates a linear-time-invariant state-space model, lin, whose states are in a specified order. Specify the state order in the cell array stateorder by entering the names of the blocks containing states in the model 'sys'. For all blocks, you can enter block names as the full block path. For continuous blocks, you can alternatively enter block names as the user-defined unique state name.
Note For all syntaxes, linearize automatically uses the following properties in the Simulink model:
Simulink restores the original property values after creating the linearized model. |
The function linoptions sets the linearization algorithm options and then passes them to the function linearize as an optional argument.
Open the Simulink model, magball, and insert linearization annotations as shown in the following figure.

Create an I/O object based on the linearization annotations, create an operating point specification object for the model, and then find the operating point using findop.
io=getlinio('magball');
op=operspec('magball');
op=findop('magball',op);
Compute a linear model of the magball system, based on the linearization I/Os, io, and defined about the operating point, op, with the command
lin=linearize('magball',op,io)
which returns
a =
Controller Current dhdt height
Controller 0 0 0 -1
Current -50 -100 0 0
dhdt 0 -2.801 0 196.2
height 0 0 1 0
b =
magball/Cont
Controller 0
Current 50
dhdt 0
height 0
c =
Controller Current dhdt height
Magntic Bal 0 0 0 1
d =
magball/Cont
Magnetic Bal 0
Continuous-time model.
The matrices, a, b, c, and d are the state-space matrices of the linear system given by the following equations:
![]()
where x(t) is a vector of states and u(t) is a vector of inputs to the system.
You can view the linearized model, lin, with the LTI Viewer, by typing:
ltiview(lin)
which produces the following plot.

findop, getlinio, operpoint, operspec, linio, linoptions, ltiview
![]() | initopspec | linio | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |