Using find between two points

54 vues (au cours des 30 derniers jours)
Darpan Verma
Darpan Verma le 11 Mar 2019
Commenté : Darpan Verma le 11 Mar 2019
Hello Everyone,
I am trying to use find in between two points, which is giving me error.
When I use
index = find(x>4)
it gives me all 100 values which are greater than x>4
if I use
index = find((x>4) && (x<6))
It gives me error: Operands to the || and && operators must be convertible to logical scalar
values.
I wanted to know how I can find the values by giving two conditions.

Réponse acceptée

David Goodmanson
David Goodmanson le 11 Mar 2019
Hi Darpan,
try it with just one & sign. && is for scalar comparisons, and you have a vector on each side.
  1 commentaire
Darpan Verma
Darpan Verma le 11 Mar 2019
Thanks David That worked. :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB 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