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.

回答(1 个)

Jan
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 个评论
Nidhi SRIVASTAVA
Nidhi SRIVASTAVA 2017-8-27
编辑:Nidhi SRIVASTAVA 2017-8-27
Precisely this is what I want to do, 'To not close the Gui', which to my knowledge I am not doing. As it enters the loop again and meets the GUI command, it opens the GUI fresh again. Could you help me further, please?
Jan
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!

Translated by