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, s
0
I've also asked this question and got a super elegant answer (non of above answers is same) here: Optimize deleting matrix leading zeros in MATLAB