www.gusucode.com > slcontrol 案例源码程序 matlab代码 > slcontrol/SpecifyStateOrderInLinearizedModelExample.m
%% Specify State Order in Linearized Model %% % Open the Simulink model. sys = 'magball'; open_system(sys) %% % Linearize the plant at the model operating point. blockpath = 'magball/Magnetic Ball Plant'; linsys = linearize(sys,blockpath); %% % View the default state order for the linearized plant. linsys.StateName %% % Linearize the plant and reorder the states in the linearized model. Set % the rate of change of the height as the second state. stateorder = {'magball/Magnetic Ball Plant/height';... 'magball/Magnetic Ball Plant/dhdt';... 'magball/Magnetic Ball Plant/Current'}; linsys = linearize(sys,blockpath,'StateOrder',stateorder); %% % View the new state order. linsys.StateName