필터 지우기
필터 지우기

Write a function to ask for given number and report whether they are between 10 and 100 or not

조회 수: 3 (최근 30일)
please try

답변 (1개)

CP
CP 2019년 3월 7일
This is extrememly simple.
function checkNumber()
tmp = input('Enter a Number: ');
inBetween10and100 = tmp >= 10 && tmp <= 100;
if(inBetween10and100 == true)
fprintf('The value %.2f is between 10 and 100\n',tmp);
else
fprintf('The value %.2f is NOT between 10 and 100\n',tmp);
end
end

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by