MATLAB: Assign inRange with 1 if userWeight is greater than 100 and lessthan or equal to 200.
Fantastic news! We've Found the answer you've been seeking!
Question:
MATLAB:
Assign inRange with 1 if userWeight is greater than 100 and lessthan or equal to 200.
---------------------------------------------------------------------------
function inRange = CheckWeight(userWeight)
% userWeight: User weight in pounds
% Assign inRange with 1 is userWeight is greater than100
% and less than or equal to 200
if (userWeight>100 | userWeight<=200)
inRange = 1 % 1 indicates user's weight is inrange
else
inRange=0
end
----------------------------------------
It is stating when CheckWeight(85) returns 1 but should be 0.Same with (100) and (245)
Related Book For
Fundamentals of Physics
ISBN: 978-0471758013
8th Extended edition
Authors: Jearl Walker, Halliday Resnick
Posted Date: