How to extract a matrix from the indexing data
2 views (last 30 days)
I have a matrix A=[256*256]. Now i find all the pixels that have values greater than certain threshold using
[row, column, dataValues] = find(A > 5);
my row matrix is 11854*1 and my column matrix is also 11854*1.
Now how do i extract these rows and columns from A. I want to compare(see) two matrices(original and extracted) side by side so i want both matrices to be of same size as well. All the pixels not satsiying the condition be 0.
Fangjun Jiang on 6 Dec 2021
They can not be scaled to the same size as A. Maybe you are looking for the matrix "index" in the below example?
see help of ind2sub() or sub2ind()
[row, column, dataValues] = find(index)