0
votes

I am trying to link an external app to a Simulink model and run the simulation step-by-step. In the model command description it says 'other MATLAB program-based tools to run a simulation step-by-step', what it does not say is how you do this.

The process looks to be:

  1. compile model

then for each time step:

  1. call outputs = model(t,x,u,'outputs');
  2. call dstates = model(t,x,u,'update');
  3. call derivs = model(t,x,u,'derivs');

What appears to be missing is the call to calculate the continuous states; does any one know how to do this?

1

1 Answers

1
votes

There is no simple call for calculating continuous states. You must write a code to calculate them.

More about that on this link: http://www.mathworks.com/matlabcentral/answers/7267-what-is-the-best-way-to-execute-a-simulink-model-step-by-step-interactively-from-matlab

There is also a set of files with example.