I have a 9800 * 49 matrix named "test1". I would like to sum 1:200 rows from column 1 and 201:400 rows from column 2 and so on… If I do it manually it would look like this:
A1=sum(test1(1:200,1));
A2=sum(test1(201:400,2));
A3=sum(test1(401:600,3));
A4=sum(test1(601:800, 4));
A5=sum(test1(801:1000, 5));
A6=sum(test1(1001:1200, 6));
….
A49=sum(test1(9601:9800, 49)
Is there any other way to do this other than manually?
Best Answer