Skip to content
Snippets Groups Projects
quit.m 642 B
Newer Older
function [] = quit()
%QUIT Closes all windows, cleans up workspace and quits ARTOA4.

global artoaGui;

if ~exist('artoaGui', 'var') || isempty(artoaGui)
    delete(gcf);
    clearvars -global artoaGui artoaDataInput artoaDataOutput artoaWorkspace;
    return;
end

openedFigures = fieldnames(artoaGui.figures);
for i = 1:length(openedFigures)
    current = openedFigures{i};
    if strcmp(current, 'main')
        continue;
    end
    delete(artoaGui.figures.(current).Number);
end

% Close main figure

clearvars -global artoaGui artoaDataInput artoaDataOutput artoaWorkspace;

end