Stream data from function to workspace in real time

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

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2023년 6월 16일

0 개 추천

댓글 수: 2

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
Did you use coder.extrinsic()?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

릴리스

R2023a

질문:

2023년 6월 16일

댓글:

2023년 6월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by