Get value from simulink model to matlab gui while simulink is running
이전 댓글 표시
With respect to following post I have some doubts related to command get_param:
1) When I use this command it returns me empty vector. 2) Can we use this command for any block like display, demux and out or it has to be Gain block only?
Thanks Mitesh
채택된 답변
추가 답변 (3개)
Paulo Silva
2011년 8월 19일
2 개 추천
- When you use get_param where? what block and what code?
- That command can only get the parameters supported by the block you are using as argument.
댓글 수: 5
Mitesh Farsodia
2011년 8월 19일
Paulo Silva
2011년 8월 19일
That only gives the handle to the object, you should use listeners instead, please see this:
http://www.mathworks.com/matlabcentral/fileexchange/24294-simulink-signal-viewing-using-event-listeners-and-a-matlab-ui
Mitesh Farsodia
2011년 8월 19일
Mitesh Farsodia
2011년 8월 19일
Kristof
2014년 4월 13일
You first have to start simulation, and right after that you can add eventlisteners.
Arunkumar Muthukumaran
2015년 12월 17일
0 개 추천
Another solution would be to use a Matlab function in your model to update the GUI handle in each timestep. Pass the value from model which needs to be displayed in GUI and update GUI handle respectively.
ian barahona
2020년 6월 1일
0 개 추천
Another posible solution is using another block instead of a "Gain" block. i used a "Product" and worked like it was a "Gain" block. rto = get_param('lm35_sim/Product','RuntimeObject');
카테고리
도움말 센터 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!