Global Map Containers and String Arrays in Simulink

3 visualizaciones (últimos 30 días)
Ahmet Sahin
Ahmet Sahin el 14 de Oct. de 2019
Comentada: Ahmet Sahin el 6 de Nov. de 2019
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 comentario
Ahmet Sahin
Ahmet Sahin el 6 de Nov. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by