Creating an array of sums of another array.
이전 댓글 표시
I have an array of 322,872 data points. I want to create another array of the sum of the numbers in the first array in segments of 730 data points (sum from 1 to 730 would be the first point in the new array, sum from 731 to 1,460 would be the second point in the new array and so on). The code I have right now (which is not working) is the following:
i = 1;
j = 730;
while j < 322871;
i = i + 730;
j = j + 730;
k = 1;
x = zeros(442,1);
while k < 441;
x(k,:) = sum(WS_50mCopy(i:j,:));
end
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!