Effacer les filtres
Effacer les filtres

Return Row of Array corresponding to a certain element?

1 vue (au cours des 30 derniers jours)
aljawada13
aljawada13 le 17 Déc 2016
Commenté : aljawada13 le 17 Déc 2016
How can I call a certain row from an array "A" that contains a certain element (say "a")?

Réponse acceptée

the cyclist
the cyclist le 17 Déc 2016
A(any(A==a,2),:)
  2 commentaires
Image Analyst
Image Analyst le 17 Déc 2016
aljawada13, if "a" is a fractional number that is not a power of 2, or an integer, be mindful of the faq for comparing floating point numbers: http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F
aljawada13
aljawada13 le 17 Déc 2016
Thanks!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Chemistry dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by