Obtain list of blocks in LinearizationAdvisor object

When you linearize a Simulink® model, you can create a LinearizationAdvisor object that contains diagnostic information about individual block linearizations, which you can use for troubleshooting linearization results. To obtain a list of the blocks in the LinearizationAdvisor object, use the getBlockPaths function.


blocks = getBlockPaths(advisor)



blocks = getBlockPaths(advisor) returns a list of block paths for the blocks in the LinearizationAdvisor object advisor.


collapse all

Load Simulink model.

mdl = 'scdspeed';

Linearize model and obtain LinearizationAdvisor object.

opts = linearizeOptions('StoreAdvisor',true);
io(1) = linio('scdspeed/throttle (degrees)',1,'input');
io(2) = linio('scdspeed/rad//s to rpm',1,'output');
[sys,op,info] = linearize(mdl,io,opts);
advisor = info.Advisor;

Find all blocks in linearization results that are numerically perturbed.

perturbed = find(advisor,linqueryIsNumericallyPerturbed);

Obtain list of numerically perturbed blocks.

blocks = getBlockPaths(perturbed)
blocks = 6x1 cell array
    {'scdspeed/Throttle & Manifold/Intake Manifold/Convert to mass charge'}
    {'scdspeed/Combustion/Torque Gen'                                     }
    {'scdspeed/Combustion/Torque Gen2'                                    }
    {'scdspeed/Throttle & Manifold/Intake Manifold/Pumping1'              }
    {'scdspeed/Throttle & Manifold/Throttle/f(theta)'                     }
    {'scdspeed/Throttle & Manifold/Throttle/g(pratio)'                    }

Input Arguments

collapse all

Diagnostic information for block linearizations, specified as a LinearizationAdvisor object or an array of LinearizationAdvisor objects.

Output Arguments

collapse all

Block paths for blocks in advisor, returned as a cell array of character vectors if advisor is a single LinearizationAdvisor object. If advisor is an array of LinearizationAdvisor objects, then blocks is a cell array with the same dimensions as advisor in which each element is a cell array of character vectors.

Introduced in R2017b

Was this topic helpful?