close all "non-existent field 'view'" error
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Jan
am 7 Mai 2018
Bearbeitet: Jan
am 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 Kommentare
Siehe auch
Kategorien
Mehr zu Descriptive Statistics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!