How can I save the figures in the subfolder of current directory path?
Show older comments
Hello,
I want to save the figures in the subfolder of current directory.
The thing is that I am running my code in two different computers and these two have different directory path.
I want to save the figures in the subfolder called figures which is under the folder 'output' so that the path should be 'D:\Dropbox\MPED\data\CEX\output\figures' or 'C:\Users\Dropbox\MPED\data\CEX\output\figures'
I tried as following but it doesn't work...
Is there anyway I can fix this?
% plot all multipliers
clear all
close all
try
cd('D:\Dropbox\MPED\data\CEX\output')
path = 'D:\Dropbox\MPED\data\CEX\output';
catch
end
try
cd('C:\Users\Dropbox\MPED\data\CEX\output')
path = 'C:\Users\Dropbox\MPED\data\CEX\output';
catch
end
.
.
.
filename = fullfile('path\figures\', strcat('result','_',specification,'_','intensive') );
print(filename, '-dpng','-r300')
%print(strcat('stimulus','_',specification,'_','intensive'),'-dpng','-r300')
hold off
end
Accepted Answer
More Answers (0)
Categories
Find more on File Operations 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!