close all "non-existent field 'view'" error
1 view (last 30 days)
Show older comments
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 Comments
Answers (2)
Jan
on 7 May 2018
Edited: Jan
on 7 May 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 Comments
See Also
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!