Returning output signals from a Simulink block to Matlab

8 visualizaciones (últimos 30 días)
Luke Chapman
Luke Chapman el 2 de Mzo. de 2023
Comentada: Paul el 9 de Jun. de 2025
I have a Simulink Block with 9 output signals which can either be 0 or 1 (true or false). Each output signal is connected to an OutBus. I want to be able to get the values for each of the signals in Matlab so I can assign them to variables and use them elsewhere. I need to be able to do this while the simulation is running, which is where I am having trouble. Any help would be appreciated.
  5 comentarios
Adil
Adil el 8 de Jun. de 2025
Editada: Adil el 8 de Jun. de 2025
@Paul Hey Paul, i know its a bit late but if i wanted to control, say the upper and lower limits of hysterisis controller which can only be changed in its special window using a variable that can be changed only in model callbacks, how would i do it such that the limits depend on output of some block. are there programable blocks where we can put matlab codes and then change it to global scope?
just as an example,thought i dont need it currently for my work
Paul
Paul el 9 de Jun. de 2025
Maybe you're looking for the functionality of the Parameter Writer block?

Iniciar sesión para comentar.

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 6 de Mzo. de 2023
  5 comentarios
Fangjun Jiang
Fangjun Jiang el 10 de Mzo. de 2023
The doc says "Your callback function can be specific to a single signal, or you can use the same callback to process and visualize multiple signals. The callback function only has access to data for a single signal at a time. "
Fangjun Jiang
Fangjun Jiang el 10 de Mzo. de 2023
Route those two signals together to make a nonvirtual bus. Make it nonvirtual or convert it to nonvirtual.

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by