필터 지우기
필터 지우기

How do I detect if the input number is within a certain range?

조회 수: 3 (최근 30일)
Michael Arvin
Michael Arvin 2022년 2월 28일
댓글: Michael Arvin 2022년 2월 28일
How do I detect the upper and lower limit of a number if the input is within a certain range?
For example:
input_Num = 3371;
i = 20000:-2500:2500;
How do code so that I am able determine within which range of i is input_Num? Which in this case, the upper is 5000 and lower is 2500.
Thank you very much!

채택된 답변

David Hill
David Hill 2022년 2월 28일
f=floor(input_Num/2500);
lower=f*2500;
upper=(f+1)*2500;

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by