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

2 views (last 30 days)
I have a 17658x1 double matrix. I want to find the values of indices when matrix elements are equal to k(here .1).

Accepted Answer

Birdman
Birdman on 24 Feb 2018
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);
  3 Comments
Abhishek Maurya
Abhishek Maurya on 25 Feb 2018
Edited: Abhishek Maurya on 25 Feb 2018
Thankyou so much. idx=find(A==k); is working properly for floating numbers too, unless the exact value of the number is known like k=3.051757812500000e-05. Thankyou Birdman,Stephen Cobeldick.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!