how can I save the all graphs with different names at the same time?
1 次查看(过去 30 天)
显示 更早的评论
I have excel file I want to plot the various column data against time column, then my question is how can I save the all graphs with different names at the same time?
0 个评论
回答(2 个)
yogesh jain
2015-9-15
Try with using of 'for' looping . every iteration of graph creation may give that different name .
Stephen23
2015-9-15
编辑:Stephen23
2015-9-15
Make a loop that loops over each figure, and save each figure. You can generate the filenames (or other info) during each loop.
This is covered very well in many posts in this forum, and also in the MATLAB wiki, including example code:
2 个评论
Stephen23
2015-9-15
编辑:Stephen23
2015-9-15
[inFileName,inPathName] = uigetfile('*.xls','Select the xls-file');
a = xlsread(inFileName);
b = a(2:1394,:);
c = b(:,7);
for k = 16:33
d = b(:,k);
dd = smooth(d);
a1 = plot(c,dd);
xlabel('time (min)');
ylabel('velocity (m/s)');
title('Graph of velocity Vs Time');
legend('zonal velocity m/s');
print(sprintf('ImageFileName_%d',k),'.png');
end
Read the print documentation for lists of the supported image formats, and other useful options.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!