Stream data from function to workspace in real time

13 visualizaciones (últimos 30 días)
Florian Dirnberger
Florian Dirnberger el 16 de Jun. de 2023
Comentada: Fangjun Jiang el 16 de Jun. de 2023
Hi Community,
i am currently working on a project where a wrote a matlab function to read sensor data. The function is running and displaying the data in the command window. I now want to use that data in simulink so i want to save the data to the base workspace to access it via simulink.
I have tried the global variable and the assignin command so far, but the variables update just after the script is finished but i want it to update while the script is running. Does anyone know a solution for this issue.
Thanks a lot
P.S. Matlab function block can not be used in simulink since some functions are not supported for code generation, which is critical

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 16 de Jun. de 2023
  2 comentarios
Florian Dirnberger
Florian Dirnberger el 16 de Jun. de 2023
Thanks for your response, I already implemented this solution but for some critical functiions called inside the function, the block does not support code generation, what is critical
Fangjun Jiang
Fangjun Jiang el 16 de Jun. de 2023
Did you use coder.extrinsic()?

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by