Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Calling back same GUI as previous in a while loop

3 Ansichten (letzte 30 Tage)
Nidhi SRIVASTAVA
Nidhi SRIVASTAVA am 27 Aug. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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.

Antworten (1)

Jan
Jan am 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 Kommentare
Nidhi SRIVASTAVA
Nidhi SRIVASTAVA am 27 Aug. 2017
Bearbeitet: Nidhi SRIVASTAVA am 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 am 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.

Community Treasure Hunt

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

Start Hunting!

Translated by