Filter löschen
Filter löschen

How to run MATLAB function and Simulink model simultaneously?

15 Ansichten (letzte 30 Tage)
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?

Akzeptierte Antwort

Kaustubha Govind
Kaustubha Govind am 12 Jul. 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.

Weitere Antworten (0)

Kategorien

Mehr zu Model, Block, and Port Callbacks finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by