필터 지우기
필터 지우기

writing excel file for every iterations

조회 수: 3 (최근 30일)
mohammed  musthafa
mohammed musthafa 2015년 5월 1일
댓글: mohammed musthafa 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)
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

답변 (1개)

Azzi Abdelmalek
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)
  댓글 수: 1
mohammed  musthafa
mohammed musthafa 2015년 5월 1일
thank you sir. this was what exactly i want

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

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by