MATLAB: I have a 17658×1 double matrix. I want to find the values of indices when matrix elements are equal to k(here .1).

indices

I have a 17658×1 double matrix. I want to find the values of indices when matrix elements are equal to k(here .1).

Best Answer

For instance, imagine you want to find 1 in a randomly generated matrix:
A=randi([1 5],17658,1);&demo data
idx=find(A==1);