writing excel file for every iterations
조회 수: 3 (최근 30일)
이전 댓글 표시
clc
clear
clc
A=xlsread('term.xlsx');
[p,q]=size(A);
X=A(:,1);
B = A(:,3);
D=[];
for i= 1:200:2001
X(i)=A(i,1);
B(i)= A(i,3);
D=[D;X(i),B(i)]
end
xlswrite('abc.xlsx',D)
by using this code am only getting last value in my ecel sheet. i want result for every results. could anyone help me thanks in advance musthafa
댓글 수: 0
답변 (1개)
Azzi Abdelmalek
2015년 5월 1일
편집: Azzi Abdelmalek
2015년 5월 1일
clc
clear
clc
A=xlsread('term.xlsx');
[p,q]=size(A);
X=A(:,1);
B = A(:,3);
D=[];
for i= 1:200:2001
X(i)=A(i,1);
B(i)= A(i,3);
D=[D;X(i),B(i)]
end
xlswrite('abc.xlsx',D)
%or you can do it simply this way
A=xlsread('term.xlsx');
D=A(1:200:2001,[1 3])
xlswrite('abc.xlsx',D)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!