Matlab App designer - use 'close all' without deleting GUI
20 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi All
A quick one but one I am having issues with. Currently I am developing a GUI which has several quite complex image processing functions within it that are activated via buttons etc within the GUI. The current issue I have is that many of these scripts currnetly use a
close all
command to clear all their handles and created figures upon finishing. The issue I am finding now is that this also closes the GUI window as well which is not what I want!
Is there an alternative way of doing this in which I can close the handles etc within the functions without closing the GUI windown itself. I have tried commenting out the 'close all' statements within the functions but this made them very buggy so I need to find a way of clearing them if at all possible....
Any answers much appreciated!
0 Commenti
Risposta accettata
Rik
il 25 Mar 2019
You can use handles returned on the opening the figure to close them:
f=figure;
%some interaction with the figure
plot(rand(2,10))
%another figure
f(2)=figure;
bar(1:4);
%close the specific figures (works with an array of handles)
close(f)
3 Commenti
Rik
il 27 Mar 2019
Glad to be of help.
As to your new problem, it might be caused by a number of things. Is your code using an ActiveX server, or the normal xlswrite tool? Does quiting the process (through taks manager) and then running it as function work?
In file IO there shouldn't really be a difference between functions and scripts.
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Debugging and Analysis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!