how to link gui and simulink?
6 次查看(过去 30 天)
显示 更早的评论
i am trying to transfer some of the test results from simulink to GUI,can you help me.....what am i suppose to do for that?
0 个评论
回答(3 个)
Sreeram Mohan
2011-11-7
Hi Antriksh,
Can u see if this file submission in fileexchange helps ? http://www.mathworks.in/matlabcentral/fileexchange/24294-simulink-signal-viewing-using-event-listeners-and-a-matlab-ui
I have not digged deep into it but seems from the description that it might help !
I will explore once i have more time if u find the above submission not helpful.
--sreeram
Fangjun Jiang
2011-11-4
You need to be more specific. Overall, in your GUI function, you can use sim() to run the simulation of your Simulink model. The results can be set up to be saved in the base workspace or function workspace. Then your GUI function will be able to access the results.
6 个评论
Fangjun Jiang
2011-11-7
If you just want the final value, use simout(end), assuming "simout" is the variable name and it is saved as "array" and it is a scalar signal. Keep in mind, that value changes if you change the simulation stop time. If you simulation stops at 10 seconds, that value reflects the signal value at 10 seconds. If the simulation stops at 100 seconds, that is the signal value at 100 seconds.
Sreeram Mohan
2011-11-4
You could just simulate the model using the command
sim
and then pass the returned results on to a edit field on a GUI using callback functions !
--sreeram
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!