有一个包含多个CVS(excel)文件的文件夹。我写下面,绘制每个文件的数字(代表一个数据集),然后打印;但每个图都打印在不同的PDF文件中 我该如何修改这个m文件
directory_name=uigetdir(pwd,'Select data directory');
directory_name=([directory_name '\']);
files=dir([directory_name,'*csv']);
if isempty(files)
msgbox('No raw files in this directory')
end
if isempty(files)
msgbox('No raw files in this directory')
end
for i_files = 1 : length(files);
filename=files(i_files).name;disp(filename)
titles(i_files) = {filename};
cc=hsv(33);
figure
X=[];IND=33;
X=load([directory_name,filename]);
plot(X)
xlabel('time')
ylabel('angle(degree)')
legend('repetitive lifting')
title(filename)
set(gcf,'Units','inches');
screenposition = get(gcf,'Position');
set(gcf,...
'PaperPosition',[0 0 screenposition(3:4)],...
'PaperSize',[screenposition(3:4)]);
print -dpdf
end