I have a matrix
A = [1 2 4 7; 2 3 1 6; 4 5 6 15]
. The last column is sum of rows
I want to make another column on right side displaying cumulative sums of last column in ascending order of the forth column (row sums). The result of last column shall be as follows:–
[22 28 15]
So, final matrix will become
[1 2 4 7 22; 2 3 1 6 28; 4 5 6 15 15].
Best Answer