Global Map Containers and String Arrays in Simulink

조회 수: 1 (최근 30일)
Ahmet Sahin
Ahmet Sahin 2019년 10월 14일
댓글: Ahmet Sahin 2019년 11월 6일
Hello,
is it possible to access to global Variables, which are made and changed with an App (made in App Designer), from the Matlab Function Block in Simulink?
After searching a while I found the method of the "Data Store Memory" Block. This didn't work for me, because my variables are Map Containers and String Arrays, which I believe is not supported by the block.
I also tried to send the variables to the Workspace and use them with the "From Workspace" Block but again, it didn't work because of the variable types.
So I need to know how to access to global Variables made in an App with the Simulink Matlab Functions Block...
Thank you for your Help!
(2019b)
  댓글 수: 1
Ahmet Sahin
Ahmet Sahin 2019년 11월 6일
I found a workaround for my problem:
I createt a new function which works between my App and Simulink.
In Simulinks Matlab Function Block I was able to call the function with the Matlab engine:
coder.extrinsic('FunctionName'); % On the top of the MATLAB Function
%Then you can call the function
FunctionName(...);
Using this I was able to use the same global variables in the called function as in the App Designer.
I hope this helps, if anyone has the same proplem as me.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by