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

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

Risposta accettata

Birdman
Birdman il 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 Commenti
Abhishek Maurya
Abhishek Maurya il 25 Feb 2018
Modificato: Abhishek Maurya il 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.

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by