I have a problem reading data from successive excel worksheets within a loop... The size of data in successive sheets are different, when I type the size of stored matrix ... it always shows the size of data in first worksheet ... why ?
[~,All]=xlsfinfo('C:\Users\bhargava\Desktop\Student data\III Year MID EXAM consolidated even sem 2016-17.xlsx');
for k=1:numel(All)
Sheets{k}=xlsread('III Year MID EXAM consolidated even sem 2016-17.xlsx',All{k});
end
[sss ddd] = xlsread('III Year MID EXAM consolidated even sem 2016-17.xlsx',All{17});
ALFe = []; ALFo = []; kk = 1;
pp = 1; while pp <= sss(:,1)
[dataPe dataNe Rawe] = xlsread('III Year MID EXAM consolidated even sem 2016-17.xlsx',All{pp});
[ss dd] = xlsread('III Year MID EXAM consolidated even sem 2016-17.xlsx',All{7});
TTe = dataPe(:,9:6:end);
[nxe nye]=size(TTe);
ne(pp) = nxe;
index = ss(1,9) % total
indT = ss(1,5) % theory
indL = ss(1,7) % lab
Le = TTe(:,indT+1:end)
Te = TTe(:,1:indT);
for i = 1:nxe % row %%passed in all subjects
for k = 1:indT
if Te(i,k) > 0.5*40
APSe(i,k) = 1;
else
APSe(i,k) = 0;
end
end
end
for i = 1:nxe % row
for k = 1:indL
if Le(i,k) > 0.4*100
VLe(i,k) = 1;
else
VLe(i,k) = 0;
end
end
end
Totale = [APSe VLe];
for i = 1:ne(kk) % row %% passed in all subjects P1 = sum(Totale(i,:)); if P1 == index %% All pass APe(i) = 1; else APe(i) = 0; end end
for i = 1:ne(kk) % row %% passed in all subjects P2 = sum(Totale(i,:)); if P2 > 3 %% Atleast three subjects passed ATPe(i) = 1; else ATPe(i) = 0; end end
for i = 1:ne(kk) % row %% passed in all subjects P3 = sum(Totale(i,:)); if P3 == 0 %% All fail ALFe(i) = 1; else ALFe(i) = 0; end end
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
2 Comments
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/408194-how-can-i-make-xlsread-read-successive-excel-worksheets#comment_584318
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/408194-how-can-i-make-xlsread-read-successive-excel-worksheets#comment_584318
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/408194-how-can-i-make-xlsread-read-successive-excel-worksheets#comment_584325
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/408194-how-can-i-make-xlsread-read-successive-excel-worksheets#comment_584325
Sign in to comment.