# x = [12 54 21 36 27 19 16 78 65 43 38 91 5 8 3 18] how can i find elements of x (the values of x) such that xi<=30 and 30<=xi<=50

1 vue (au cours des 30 derniers jours)
Waleed Alrabghi le 18 Fév 2016
Réponse apportée : Jan le 19 Fév 2016
x = [12 54 21 36 27 19 16 78 65 43 38 91 5 8 3 18] how can i find elements of x (the values of x) such that xi<=30 and 30<=xi<=50
##### 0 commentairesAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (2)

Jon le 18 Fév 2016
Modifié(e) : Jon le 18 Fév 2016
Look at the find() function. You can use logical operators like < , > , and = . Just try some things and see what happens.
##### 2 commentairesAfficher 1 commentaire plus ancienMasquer 1 commentaire plus ancien
Torsten le 19 Fév 2016
Why not just testing it ?
Many big inventions would not have been possible without the curiosity of the people engaged in the subject.
Best wishes
Torsten.

Connectez-vous pour commenter.

Jan le 19 Fév 2016
A further hint: "30<=xi<=50" might be misleading, because Matlab processes such terms from right to left. Therefore you need to connect the two relations by an and():
30 <= x & x <= 50
##### 0 commentairesAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

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