A(:,:,1) =
1 1 0 0 1 1 1 1 1
A(:,:,2) =
1 0 0 0 0 1 0 0 1
I used [r,c,v] = ind2sub(size(A),find(A == 1)); to find r,c,v in matrix A that has a value 1. But I want to place a condition that while A == 1 then I(r,c) = v
for example I(1,1) = {1,2} since for v=1,2 A takes a value 1. Please help me out with a code.
Best Answer