Azzera filtri
Azzera filtri

How to run MATLAB function and Simulink model simultaneously?

15 visualizzazioni (ultimi 30 giorni)
I have a MATLAB function that displays a figure I draw using annotations and I have a Simulink model that records brain signals. What I want to do is run both at the same time, that is, to record the brain signals while the user is looking at the figure displayed by my MATLAB function. When the simulation is over I would display another image from another MATLAB function. What's the best way to do this?

Risposta accettata

Kaustubha Govind
Kaustubha Govind il 12 Lug 2013
You can run MATLAB code "simultaneously" with a model only by running it as part of the simulation loop. This can be done by invoking the code using one of the three MATLAB Function blocks from the User-Defined Functions Library.
To run additional code at the end of simulation, configure the model's StopFcn callback to execute the code.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by