Take for example matrix a:
a=[1 2 3 4; 5 8 10 1; 2 3 11 12].
Numbers recurring in different rows should create a new row and be emitted from the row they were in before, giving us the matrix:
a=[1 0 0; 2 3 0; 4 0 0; 5 8 10; 11 12 0]
repeating values in matrix
a=[1 2 3 4; 5 8 10 1; 2 3 11 12].
a=[1 0 0; 2 3 0; 4 0 0; 5 8 10; 11 12 0]
Best Answer