Sum values for a spreedsheet of excel
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Tony Castillo
am 23 Sep. 2016
Kommentiert: Tony Castillo
am 4 Okt. 2016
Hello, i want to do this:
- load a excel spreedsheet
- read that excel spreedsheet
- set a stepsize of 4 numbers
- sum from 4 by 4 the elements of the column vector
- generate a new column vector only with the the new values (for instance if at the begining i had 8 values now i should has only 2 values)
this was the code that i did for it,
k = 1;
stepsize = 4;
xlsread('DatosCM.xlsx', 1, 'c2:c10');
for nn = 2:stepsize:10-stepsize
partsum(k) = sum(vekt(nn:nn+stepsize-1));
k = k+1;
end
that code send me this error Index exceeds matrix dimensions.
Error in consumo2 (line 7) partsum(k) = sum(vekt(nn:nn+stepsize-1));
1 Kommentar
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!