MATLAB: How to solve this problem [Output argument ‘fever’ is not assigned on some execution paths]

fevernotfever

I've been in this problem almost three months. I don't know what to do anymore.
I just want the output to display according to the condition given. If y > 3.74, display the value of fever. If y < 3.74, display the value of notfever. But because of the errors, I cannot proceed.
It is an honoured if anybody could help me to solve this error. here I attach the code that I'm used in Matlab function block.
function [fever,notfever] = detection(y)
if y > 37.4
fever = y;
else y < 37.4
notfever = y;
end
end

Best Answer

In your code, what should be assigned to fever if y is not > 37.4 ? What should be assigned to notfever if y is not < 37.4?
Your code has to be written to assign something to each of the output variables. Even if it ends up looking like
function [fever,notfever] = detection(y)
if y > 37.4
fever = y;
notfever = inf;
else y < 37.4
notfever = y;
fever = inf;
else
fever = inf;
notfever = inf;
end
end