www.gusucode.com > simulink 案例源码程序 matlab代码 > simulink/FinalStateInformationinStructurewithDatasetFormatExample.m

    %% Final State Information in Structure with Dataset Format  
% Saved final state information in |Dataset| format and access the state
% data after simulation.   

%% 
% Open the |vdp| model and specify to log final states in |Dataset| format.
% Use the default logged state variable, |xFinal|. 
open_system('vdp');
set_param(gcs,'SaveFinalState','on','SaveFormat','Dataset');  

%% 
% Simulate the model. 
sim('vdp');  

%% 
% View the state logging information in |xFinal|. 
xFinal  

%% 
% Examine the first element of the state dataset. 
xFinal.get(1)