Friday, 9 August 2013

From a matrix how to shift zero in the last column in matlab

From a matrix how to shift zero in the last column in matlab

I have one matrix like below-
A=[1 1 1 1 1; 0 1 1 1 2; 0 0 1 1 3]
But I want to place all the 0 at the end of the row, so A should be like-
A=[1 1 1 1 1; 1 1 1 2 0; 1 1 3 0 0]
How can I do this? Matlab experts please help me.

No comments:

Post a Comment