Question: MATLAB: Assign inRange with 1 if userWeight is greater than 100 and lessthan or equal to 200. --------------------------------------------------------------------------- function inRange = CheckWeight(userWeight) % userWeight: User

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)


Step by Step Solution

3.51 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

function inRange CheckWeightuserWeight Matlab function that takes a userWeight as input and retu... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!