Info
此问题已关闭。 请重新打开它进行编辑或回答。
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 次查看(过去 30 天)
显示 更早的评论
filename = 'project3data.xlsx';
num = xlsread('project3data.xlsx');
for i = 1:55
milesdriven = sum(num(2,2:11))
end
1 个评论
Walter Roberson
2016-12-5
Duplicates http://www.mathworks.com/matlabcentral/answers/315288-how-do-i-get-i-to-loop-through-the-55-columns-of-the-excel-file-one-by-one-i-want-i-to-correspond-t which is waiting for a response.
Please do not continue to discuss here.
回答(1 个)
Tamir Suliman
2016-12-5
filename = 'project3data.xlsx';
num = xlsread('project3data.xlsx');
for i = 1:55
for j =2:11
milesdriven = sum(num(i,j))
end
end
1 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!