Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How can I plot various graphs at a time and save it with different names?

조회 수: 1 (최근 30일)
Heramb Gaikwad
Heramb Gaikwad 2015년 9월 23일
마감: MATLAB Answer Bot 2021년 8월 20일
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?
I have attached Excel file. I want to plot seventh column (Time) with 8-33 columns. I have tried the following possibilities by using for as well as while loops but it plots the all graphs but can't save the single graph.
=by using for loop
[inFileName,inPathName] = ('*.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
=by using while loop
[inFileName,inPathName] = uigetfile('*.xls','Select the xls-file');
a = xlsread(inFileName);
b = a(2:1394,:);
c = b(:,7);
k=16;
while k<=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.png',k));
k=k+1;
end

답변 (1개)

Heramb Gaikwad
Heramb Gaikwad 2015년 9월 23일
this is Excel file want to plot 7th column with 8-33 ones and plot and save graphs with different names.
  댓글 수: 1
Walter Roberson
Walter Roberson 2015년 9월 23일
The file did not get attached.
After you select the file to attach you need to click on Attach File in order to transfer the file to Mathworks.

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by