For example, the Watertank model has three parameters defined as MATLAB workspace
variables, a, b, and A. The following commands specify a parameter grid for the single
parameter for A.
param.Name = 'A';
param.Value = Avals;
Here, Avals is an array specifying the sample values for A.
The following table lists some common ways of specifying parameter samples.
Parameter Sample-Space Type How to Specify the Parameter Samples
Linearly varying param.Value =
linspace(A_min,A_max,num_samples)
Logarithmically varying param.Value =
logspace(A_min,A_max,num_samples)
Random param.Value = rand(1,num_samples)
Custom param.Value = custom_vector
If the variable used by the model is not a scalar variable, specify the parameter name as
an expression that resolves to a numeric scalar value. For example, suppose that Kpid is
a vector of PID gains. The first entry in that vector, Kpid, is used as a gain value in a
block in your model. Use the following commands to vary that gain using the values given
in a vector Kpvals:
param.Name = 'Kpid(1)';
param.Value = Kpvals;
After you create the structure param:
- Pass it to linearize as the param input argument.
- Pass it to slLinearizer as the param input argument, when creating an
slLinearizer interface. - Set the Parameters property of an existing slLinearizer interface to param.
Vary Single Parameter in Graphical Tools
To specify variations of a single parameter for batch linearization in Linear Analysis Tool,
in the Linear Analysis tab, in the Parameter Variations drop-down list, click Select
Specify Parameter Samples for Batch Linearization