Global Map Containers and String Arrays in Simulink

1 次查看(过去 30 天)
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