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
Best Answer