Global Map Containers and String Arrays in Simulink

3 views (last 30 days)
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!
  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
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)


Find more on Interactive Model Editing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by