Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Simple question how do I adjust the for loop to go through the rows of the excel matrix one by one. Milesdriven adds the columns 2:11 of the first row, i want the calculation to be done for the next 54 rows as well.

1 Ansicht (letzte 30 Tage)
filename = 'project3data.xlsx';
num = xlsread('project3data.xlsx');
for i = 1:55
milesdriven = sum(num(2,2:11))
end

Antworten (1)

Tamir Suliman
Tamir Suliman am 5 Dez. 2016
filename = 'project3data.xlsx';
num = xlsread('project3data.xlsx');
for i = 1:55
for j =2:11
milesdriven = sum(num(i,j))
end
end

Community Treasure Hunt

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

Start Hunting!

Translated by