Global Map Containers and String Arrays in Simulink

4 views (last 30 days)
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 Comment
Ahmet Sahin
Ahmet Sahin on 6 Nov 2019
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.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by