Skip to content

Instantly share code, notes, and snippets.

@morganp
Created November 28, 2011 10:32
Show Gist options
  • Save morganp/1399912 to your computer and use it in GitHub Desktop.
Save morganp/1399912 to your computer and use it in GitHub Desktop.
Matlab run Simulink modern syntax
%% Run simulation
sim_length = samples/fs_in;
% [answer.t, answer.x, answer.y] = sim( 'testharness', sim_length );
paramNameValStruct.StartTime = '0.0' ;
paramNameValStruct.StopTime = num2str(sim_length) ;
sim_result = sim( 'testharness', paramNameValStruct);
%% Get the results
%% there is a To Workspace block outputting to 'simout' as a Structure
simout = sim_result.find('simout') ;
data = simout.signals.values ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment