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

    %% Simulate Model with |sim| Command-Line Options  
% Simulate the model, |vdp|, in Rapid Accelerator mode for an absolute
% tolerance of |1e-5| and save the states in |xoutNew| and the output in |youtNew|.
%
% Specify parameters as name-value pairs to the |sim| command: 
simOut = sim('vdp','SimulationMode','rapid','AbsTol','1e-5',...
            'StopTime', '30', ... 
            'ZeroCross','on', ...
            'SaveTime','on','TimeSaveName','tout', ...
            'SaveState','on','StateSaveName','xoutNew',...
            'SaveOutput','on','OutputSaveName','youtNew',...
            'SignalLogging','on','SignalLoggingName','logsout')