close all "non-existent field 'view'" error
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am working on a code which yield error at command
close all
The error is
>> close all
Error using close
Reference to non-existent field 'views'.
_Error in close
Caused by:
Error while evaluating figure CloseRequestFcn_
Acutally, I found it was commonly used.
But it simply doesn't work on my computer. I google it, no post talking about it. Is there anything with my matlab?
My matlab version is 2017a.
3 commentaires
Réponses (2)
Jan
le 7 Mai 2018
Modifié(e) : Jan
le 7 Mai 2018
It seems like one of the figures has a failing CloseRequestFcn. Try to identify it by using the debugger. Type this in the command window:
dbstop if error
and run the code again. Does this offer any further information about which window causes the troubles? If not:
FigList = findall(groot, 'Type', 'figure');
for k = 1:numel(FigList)
Fig = FigList(k);
disp([Fig.Name, ' ', Fig.Title]);
close(Fig)
end
Is there any user-defined code in the CloseRequestFcnof the failing figure? If so:
function bruteCloseAll
FigList = findall(groot, 'Type', 'figure');
for k = 1:numel(FigList)
Fig = FigList(k);
try
close(Fig);
catch ME
fprintf('Forced closing after error: %s\nFigure: %s\n', ...
ME.message, [Fig.Name, ' ', Fig.Title]);
set(Fig, 'CloseRequestFcn', '', 'DeleteFcn', '');
close(Fig)
end
end
end
0 commentaires
Voir également
Catégories
En savoir plus sur Descriptive Statistics dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!