Hi I have a 2D array like this
A=[0 0 1; 1 0 1; 0 1 0]
I want to replace 1 in each row with column index value. e.g new matrix will be like this:
result=[0 0 3 ; 1 0 3 ; 0 2 0]
Thanks in advance
A=[0 0 1; 1 0 1; 0 1 0]
result=[0 0 3 ; 1 0 3 ; 0 2 0]
Best Answer