How can I change the place of two numbers randomnly in a row in a matrix? For example;
a=[1 0 0 0 0 0; 0 0 1 0 0 0; 0 1 0 0 0 0; 0 0 0 1 0 0];
and , I want to change the places of the numbers in each row. Then I want to find; this matrix:
a=[0 0 1 0 0 0; 0 1 0 0 0 0; 0 0 0 0 1 0; 0 0 0 0 0 1];
How can I write a code for this?
Best Answer