필터 지우기
필터 지우기

how to save loop data in one excel file?

조회 수: 2 (최근 30일)
addy fang
addy fang 2020년 7월 7일
댓글: addy fang 2020년 7월 7일
I was trying to save the following into one excel file, and do not how to do it. I only got three column data from the last sheet.
origindata=importdata(\rawdata.txt');
for t=(0.1:0.1:1)
f=origindata(:,1);
a=origindata(:,2);
b=origindata(:,3);
c=origindata(:,4);
d=origindata(:,5);
e=a-j*b;
u=c-j*d;
rl=f*0.01*t/3.*(u.*e)
plot(f,rl);
y1(:,1)=f;
y1(:,2)=rl;
y1(:,3)=t;
y1;
hold on;
end
xlswrite('\Desktop\sample',y1);

답변 (1개)

madhan ravi
madhan ravi 2020년 7월 7일
편집: madhan ravi 2020년 7월 7일
writetable(array2table(y1, 'VariableNames', {'f', 'rl', 't'}), '\Desktop\sample.xlsx')
  댓글 수: 2
addy fang
addy fang 2020년 7월 7일
This gave the same as "xlswrite('\Desktop\sample',y1);" It only gave the last spread sheet with three columns. It should give 30 columns.
addy fang
addy fang 2020년 7월 7일
I figured it out. Thank you.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by