How can I show Data generated in Simulink in a Matlab GUI?

조회 수: 1(최근 30일)
I have a Simulink Model that creates Data. I built a GUI using uicontrol (not GUIDE) that gives parameters to the model (via workspace). A pushputton activates a nested function that gets the inputs and saves them. (get and assignin). Now I run the model (still in nested function), but the To Workspace Block does not work.
Error using GUI_01_FOM_frict/save_input (line 122)
Cannot create variable 'FOM_frict_phi' in workspace
Caused by:
Error using GUI_01_FOM_frict/save_input (line
Attempt to add "FOM_frict_phi" to a static
See Variables in Nested and Anonymous
Error while evaluating UIControl Callback.
Same Error if call a script which has the sim command
I tried for several hours now to work around that, but I cannot find a solution.
I would appreciate any idea that could help
  댓글 수: 3
André Köhler
André Köhler 2019년 9월 18일
Hello Ankit,
no, I want to acces the Data after the simulation, no need for real time because the simulation time is maximum 3 seconds.
At this point, I dont have this error anymore because I initialize FOM_frict_Phi = [ ].
But The Data only shows up in this variable when I click Play directly in Simulink, but not when I simulate using Matlab.

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


Abhishek Gupta
Abhishek Gupta 2020년 9월 8일
편집: Abhishek Gupta 2020년 9월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by