A pool of applicants to be considered for a medical research

A pool of applicants to be considered for a medical research study related to diabetes. The candidates are listed below with their relevant medical data. The researchers conducting the study want to limit its participants (i.e., those include in the study as subjects) according to the following criteria: Height: Between 60 and 80 inches. Age: Between 18 and 50 years. Weight: Between 110 and 220 lbs Blood glucose: Between 70 to 120 mg/dL Non-Smokers only write a program that selects and identifies (by candidate number) acceptable applicants from the above list.

Solution

%matlab function

function [candno nonselcand]= select_cand(CN,H,A,W,BG,SMYN)
if H<80 && H>50
if A>18 && A<50
if W>110 && W<220
if BG>70 && BG<120
if SMYN==0
candno = CN;%takes the selected candidate
nonselcand = 0;%if he is selected then not selected candidate becomes 0
return;
end
end
end
end
nonselcand = CN;%if he is not selected we take into not selected variable
candno = 0;%selected candidate variable becomes 0
end

%I am taking four inputs

[s(1) ns(1)] = select_cand(1,63,18,105,145,0);
[s(2) ns(2)] = select_cand(2,69,17,179,110,0);
[s(3) ns(3)] = select_cand(3,78,34,189,90,1);
[s(4) ns(4)] = select_cand(4,69,35,245,123,0);
disp(s);

%s array gives selected candidates

%ns gives ns candidates

% till four input the output is all zeros

 A pool of applicants to be considered for a medical research study related to diabetes. The candidates are listed below with their relevant medical data. The r

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site