Limiting the values of a column

2 vues (au cours des 30 derniers jours)
Hazem Al-Bulqini
Hazem Al-Bulqini le 14 Sep 2020
I have a column 'y' contains different values. I want to only take the values between -10 and 10 in an other column.
How can I do that?
  2 commentaires
Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam le 14 Sep 2020
Is it a matrix or table, can you show your variable?
Hazem Al-Bulqini
Hazem Al-Bulqini le 14 Sep 2020
A vector of almost 70000 rows and one column.

Connectez-vous pour commenter.

Réponse acceptée

the cyclist
the cyclist le 14 Sep 2020
If you mean that y is a column vector, then
y_new = y((y>=-10) & (y<=10))
will give you a new column vector with only the values between (and including) -10 and 10.
  1 commentaire
Hazem Al-Bulqini
Hazem Al-Bulqini le 14 Sep 2020
Yes, thank you.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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