Info

This question is closed. Reopen it to edit or answer.

How to run a simulink simulation from an m-file, and get data from simulation before the m-file is terminated? And then update the model, and start all over again.

1 view (last 30 days)
I'm attempting to tune a DC motor using a PID controller and Simulink. My goal is to use the Ziegler-Nichols method, which is an iterative method.
I would like to be able to run my simulation, get some data, do some computations, update my model and then start all over again - without actually having to update my model after every iteration. Until the results I desire are achieved.
The problem I am having is Simulink does not update the workspace until my script as completely terminated. So I can't do any computations with my workspace data from my script.
I've been researching different solutions over the past couple of days, but I have had no success. Any help would be much appreciated!

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!