writing excel file for every iterations
3 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Azzi Abdelmalek
on 1 May 2015
Edited: Azzi Abdelmalek
on 1 May 2015
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)
See Also
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!