Info

This question is closed. Reopen it to edit or answer.

Calling back same GUI as previous in a while loop

1 view (last 30 days)
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.

Answers (1)

Jan
Jan on 27 Aug 2017
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 Comments
Nidhi SRIVASTAVA
Nidhi SRIVASTAVA on 27 Aug 2017
Edited: Nidhi SRIVASTAVA on 27 Aug 2017
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 on 27 Aug 2017
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.

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!