vendredi 27 février 2015

How to give value of string to another string in matlab

I have a simple question. I want to calculate training heart rate.And I have some values. RHR means that resting heart rate. INTEN means fitnes level and I give values 0.55,0.65,0.8 for low, medium and high fitness level I wrote that code



Gender=input('Please input your gender: ');
Age=input('Please input your age: ');
RHR=input('Please enter your resting heart rate: ');
INTEN=input('Please enter your fitness level(low,medium or high): ');
male=Male;
female=Female;
low=0.55;
medium=0.65;
high=0.8;
if INTEN==0.55
INTENT=0.55;
elseif INTENT==medium
INTENT=0.65;
else
INTENT=0.8;
end
if Gender==Male
THR=((220-Age)-RHR)*INTEN+RHR;
elseif Gender==Female
THR=((206-0.88*Age)-RHR)*INTEN+RHR;
end
disp('The recommended training heart rate is ',num2str(THR))


But it gave error why?


Aucun commentaire:

Enregistrer un commentaire