Filter löschen
Filter löschen

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

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

Akzeptierte Antwort

Birdman
Birdman am 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 Kommentare
Abhishek Maurya
Abhishek Maurya am 25 Feb. 2018
Bearbeitet: Abhishek Maurya am 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by