sw-plotting-tool/saveFigs.m
2022-12-30 22:44:46 +01:00

24 lines
660 B
Matlab

function saveFigs(folder, figureVar, channelName, path, file)
%Suppress the warnings. If not where would be a lot of warnings
%because of the creation of folders that already exist
warning('off','all');
%Create file folder
file = strcat(path, '\', file);
mkdir(file);
%Create type folder (graph, mean, fourier)
folder = strcat(file, '\', folder);
mkdir(folder);
%Create path for saving and save as .fig and .png
pathName = strcat(folder, '\', channelName);
savefig(figureVar, strcat(pathName, '.fig'));
saveas(figureVar, strcat(pathName, '.png'));
%Turn warning back on
warning('on','all')
end