Hi given a matrix
M= [ 0 4 8 6; 0 0 0 6; 0 0 0 6; 2 0 0 0; 0 0 0 0; 0 0 0 1; 0 4 7 0; 5 3 0 0; 0 0 0 6; 0 0 0 6;];
I want to create a new matrix A that contain just the diversity, no matter of the order and with no zeros.
so in this case
A = [2 4 8 6; 5 3 7 1];
Someone can help me with the code?
Best Answer