run m-file from push button in Matlab GUI
4 次查看(过去 30 天)
显示 更早的评论
Hello
I need to run an untitled.m (mfile) by hitting an push button in GUI. This m-file is a script. It contains only some variables. These variables are just numbers, not an array or structure..etc.These numbers are needed for running simulink model.
So this is my problem. GUI,2 buttons, one runs mfile,second runs simulink model using data from mfile. I tried several things which i found using google,i solved nothing
Any ideas? Thanks a lot for your time and help
1 个评论
采纳的回答
Sean de Wolski
2012-4-10
Put:
untitled
In the callback function of the pusbutton.
More per Feedback
If no error is being thrown then it is most likely running. The issue you are seeing is that it's running, generating all of those constants in the callback function workspace and then they are cleared when the callback ends. If you would liek them in the base, then use ASSIGNIN or EVALIN to move those variables from the Callback workspace to the base workspace.
doc evalin
doc assignin
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!