simulink and gui across workspace

in simulinke model there is a "to workspace " assume its var is "sout" that i want this var "sout" identified by my gui program

 채택된 답변

TAB
TAB 2012년 7월 2일

2 개 추천

Simulink data from To Workspace block is always saved in Matlab base workspace. So your variable "sout" will appear in matlab base workspace after the simulation.
You can access this variable in you GUI program (or in any other) function using
data = evalin('base','sout');
Using this, values in "sout" from base workspace will be copied in variable "data".

댓글 수: 9

mohamed  al-asklany
mohamed al-asklany 2012년 7월 2일
perfect ,that is very nice but if smulinke still running can i use the same expression
TAB
TAB 2012년 7월 2일
No. Simulink saves all the data through To Workspace block only after the completion of simulation. So this data will not be available during simulation.
mohamed  al-asklany
mohamed al-asklany 2012년 7월 2일
that is a big problem ,i need another way to send data to my gui ?
Kaustubha Govind
Kaustubha Govind 2012년 7월 2일
If you want to access your data during simulation, please see http://www.mathworks.com/help/toolbox/simulink/ug/f13-92122.html
Alternatively, you could write a MATLAB S-function block that is connected at the appropriate signals to update your GUI.
mohamed  al-asklany
mohamed al-asklany 2012년 7월 4일
need simple solution
TAB
TAB 2012년 7월 5일
편집: TAB 2012년 7월 5일
Simplest event listener demo is here.
Once go through your own this and this posts.
mohamed  al-asklany
mohamed al-asklany 2012년 7월 5일
done thanks for you all still simple problem this function make my gui slower and the function can not run when i run another thing in my gui
TAB
TAB 2012년 7월 5일
What another thing you are running in your GUI ?
mohamed  al-asklany
mohamed al-asklany 2013년 7월 17일
antenna radar scope contain order pause(.05)

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by