mdl_index = params(1).Value == max(Kp2_range) & params(2).Value == max(Ki2_range);
Obtain the complementary sensitivity transfer function at y2.
sys = getCompSensitivity(sllin,'y2','y1m',mdl_index);
Obtain Offsets from Complementary Sensitivity Function
Open Simulink model.
mdl = 'watertank';
open_system(mdl)
Create a linearization option set, and set the StoreOffsets option.
opt = linearizeOptions('StoreOffsets',true);
Create slLinearizer interface.
sllin = slLinearizer(mdl,opt);
Add an analysis point at the tank output port.
addPoint(sllin,'watertank/Water-Tank System');
Calculate the complementary sensitivity function at y, and obtain the corresponding
linearization offsets.
[sys,info] = getCompSensitivity(sllin,'watertank/Water-Tank System');
getCompSensitivity