필터 지우기
필터 지우기

how to extract just a value lower than 1

조회 수: 5 (최근 30일)
Pichawut Manopkawee
Pichawut Manopkawee 2016년 11월 8일
댓글: Pichawut Manopkawee 2016년 11월 8일
Hi all,
I have a .mat file containing a varied number from less than 0 to much more than 0. I would like to extract or just concentrate on value just below 0, I will give them as 1. Also, the numbers which are greater than 1, I would give them as 0.
I know if statement is useful for this, but I don't know how to do that. Anyway, is there any function like x(isnan(x))=0 that change the conditional number below 0 to be 1?
Thanks in advance, Pich

채택된 답변

Walter Roberson
Walter Roberson 2016년 11월 8일
x(x < 0) = 1;
x(x > 1) = 0;
  댓글 수: 1
Pichawut Manopkawee
Pichawut Manopkawee 2016년 11월 8일
Thanks Walter,
I just know that there is an easy way to cope with this. Thanks again.
Pich

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by