1 1
2 2
>> B
B =
3 4
3 4
Create the structure array, params, that specifies the parameter grid.
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, linearizing 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 3-69,
suppose you want to linearize 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';
3 Batch Linearization