Info
此问题已关闭。 请重新打开它进行编辑或回答。
Calling back same GUI as previous in a while loop
1 次查看(过去 30 天)
显示 更早的评论
I am working on a program which follows the following structure. I run a while loop whose beginning starts with calling a GUI with some initial default values.I change the values in the edit box of the gUi and Then several operations are run based on the values entered in GUI. After completing a cycle as it enters loop the second time, GUI is called again. But this time I want my GUI to show the previous values. I know this could be done with loadState, saveState but I don't want the GUI to retrieve previous value when the whole program is run again. To keep it simple, I want to start with initial values, keep making change to gui such that every time when while loop runs it shows previous values, but when the program ends and is restarted, the first GUI which appears show the initial default value. If anyone could suggest me anything in this regard, it will be very helpful. Thanks.
0 个评论
回答(1 个)
Jan
2017-8-27
It sounds like all you need is not to close the GUI but keep it open with using the new values.
The description
After completing a cycle as it enters loop the second time, GUI is called again.
is vague only, so I cannot suggest some real code. But the core of the problem seems to be inside "GUI is called again". Do not close the figure, but update its contents. If you want more details, post the relevant part of the code.
2 个评论
Jan
2017-8-27
As long as you do not provide any details, how could I help? "it enters the loop again" and "meets the GUI command" - well, you have to modify the code, obviously. But I cannot know, how the code looks like after your rough rephrasing as text. All I can do is to recommend to remove the code, which "opens the GUI fresh again" and replace it by a version which only updates the contents.
Again: A more specific help is possible, if you post the relevant part of the code. I cannot read your files or your mind.
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!