MATLAB: Fprintf- I dont want to print one result.

fprintfif/elseif/elsenot print a result

This is my code. I want that when the person put the value 0, the message print ONLY "Negative,has not being infected". But instance it give also the hour of being infected.
x= input ('Enter x: '); %Degree of reaction to the virus from a blood test.
if x==0
disp ('Negative, has not being infected.')
N=0;
elseif x<=11
N= 3*x + 36;
elseif x > 11 && x<=33
N= x*x - 10;
elseif x > 33 && x<=64
N= x-6;
end
fprintf('\n%g hours of being infected.\n',N)

Best Answer

clear
clc
x= input ('Enter x: '); %Degree of reaction to the virus from a blood test.
showHours = 1;
if x==0
disp ('Negative, has not being infected.')
N=0;
showHours = 0;
elseif x<=11
N= 3*x + 36;
elseif x > 11 && x<=33
N= x*x - 10;
elseif x > 33 && x<=64
N= x-6;
end
if showHours
fprintf('\n%g hours of being infected.\n',N)
end