ct = 1:20;
k1val = 1+(ct-10)/100;
k2val = 1+(ct-10)/100;
params(1).Name = 'k1';
params(1).Value = k1val;
params(2).Name = 'k2';
params(2).Value = k2val;
t = cputime;
sys_params = linearize(mdl,op,io,params);
View the total time to compute the 20 linearizations with one call to the linearize
command. In this case, the model is compiled only once when varying the specified
parameters.
dt_params = cputime - t
dt_params =
12.8281
Compare Results
In this example, the varying parameters do not impact the operating point of the Simulink
model. The linearizations using both approaches are equivalent.
bode(sys_forloop(:,:,1),sys_params(:,:,1))
legend('Linearization in FOR loop','Linearization using parameter structure')
3 Batch Linearization