Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
I have a 17658x1 double matrix. I want to find the values of indices when matrix elements are equal to k(here .1).

Réponse acceptée

Birdman
Birdman le 24 Fév 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 commentaires
Abhishek Maurya
Abhishek Maurya le 25 Fév 2018
Modifié(e) : Abhishek Maurya le 25 Fév 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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by