params(1).Name = 'a';
params(1).Value = A;
params(2).Name = 'b';
params(2).Value = B;
In general, to specify a full grid for N parameters, use ndgrid to obtain N grid arrays.
[P1,...,PN] = ndgrid(p1,...,pN);
Here, p 1 ,...,pN are the parameter sample vectors.
Create a 1 x N structure array.
params(1).Name = 'p1';
params(1).Value = P1;
params(N).Name = 'pN';
params(N).Value = PN;
Specify Subset of Full Grid
If your model is complex or you vary the value of many parameters, trimming the model
for the full grid can become expensive. In this case, you can specify a subset of the full
grid using a table-like approach. Using the example in “Specify Full Grid” on page 1-98,
suppose that you want to trim the model for the following combinations of a and b:
(a 1 ,b 1 ),(a 1 ,b 2 )
Create the structure array, params, that specifies this parameter grid.
A = [a1 a1];
params(1).Name = 'a';
params(1).Value = A;
B = [b1 b2];
params(2).Name = 'b';
params(2).Value = B;
Batch Trim Model for Parameter Variations
This example shows how to obtain multiple operating points for a model by varying
parameter values. You can study the controller robustness to plant variations by batch
linearizing the model using the trimmed operating points.
Batch Compute Steady-State Operating Points for Parameter Variation