When I am running my GUI, I get all of the files and data selected and then press plot. It plots the data but closes the GUI so I have to redo it every time. Is there a way to make a code that keeps the GUI open so that I can just edit the data if I want to make different plots without having to redo the GUI every time?

 채택된 답변

Adam Danz
Adam Danz 2021년 3월 12일
편집: Adam Danz 2021년 3월 12일

1 개 추천

There's a line in the GUI code or within one of the callback functions that is closing the GUI figure or making it invisible. Look for something like,
close(figureHandle)
% or
delete(figureHandle)
Remove that line or comment it out to prevent the GUI from closing.
If you mean that the GUI is minimized but not closed, you can bring the GUI figure back into focus using,
figure(figureHandle)

댓글 수: 3

Alexander McIntyre
Alexander McIntyre 2021년 3월 12일
Can I make a callout to keep it open possibly? Thanks.
Adam Danz
Adam Danz 2021년 3월 12일
Not sure what you mean by a callout.
There must be a button or some user action that does the plotting and then closes the GUI. Find the callback function for that button or user-action and look in the code to find where the GUI closes. Better yet, step through the callback function in debug mode. Matlab's Doc on debugging
Alexander McIntyre
Alexander McIntyre 2021년 3월 12일
Just found it. Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Rishabh
Rishabh 2025년 4월 29일

0 개 추천

figure(app.UIFigure);
just add this after everything into your button pushed callback

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

질문:

2021년 3월 12일

답변:

2025년 4월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by