Borrar filtros
Borrar filtros

How to run MATLAB function and Simulink model simultaneously?

15 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Model, Block, and Port Callbacks en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by