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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by