Limiting the values of a column

2 ビュー (過去 30 日間)
Hazem Al-Bulqini
Hazem Al-Bulqini 2020 年 9 月 14 日
コメント済み: Hazem Al-Bulqini 2020 年 9 月 14 日
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 件のコメント
Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020 年 9 月 14 日
Is it a matrix or table, can you show your variable?
Hazem Al-Bulqini
Hazem Al-Bulqini 2020 年 9 月 14 日
A vector of almost 70000 rows and one column.

サインインしてコメントする。

採用された回答

the cyclist
the cyclist 2020 年 9 月 14 日
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 件のコメント
Hazem Al-Bulqini
Hazem Al-Bulqini 2020 年 9 月 14 日
Yes, thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by