Write a MATLAB computer program that will provide the information needed to prep
ID: 3668298 • Letter: W
Question
Write a MATLAB computer program that will provide the information needed to prepare a sample of a diluted drug for injection. When executed, the program should query the user for the following information:
The volume of the sample of the diluted drug that is to be prepared (mL)
The total amount of the drug to be injected (mg drug/kg body mass)
The volume of solution in the drug bottle (mL)
The patient’s body mass (kg)
The total mass of the drug in the bottle (mg) (assume that the rest is saline)
Assuming you have an unlimited supply of sterile saline, the program should calculate and display the following:
The concentration of the drug in the bottle.
The volume of concentrated drug (in mL) and the volume of saline (in mL) that are to be combined to make the requested volume of the sample of the diluted drug.
Test your program using the following test data:
Volume of the sample of the diluted drug that is to be prepared = 2 mL
Total amount of the drug to be injected = 0.0210 mg/kg body weight
Volume of solution in the drug bottle = 30.0 mL
Patient’s body mass = 70.0 kg
Total mass of the drug in the bottle = 294 mg
Explanation / Answer
prompt ='The volume of the sample of the diluted drug that is to be prepared';
v_sample=input(prompt)
prompt ='total amount of the drug to be injected (mg drug/kg body mass)';
t_drug=input(prompt)
prompt='volume of solution in the drug bottle (mL)';
v_bottle=input(prompt)
prompt='patient’s body mass (kg)';
m_patient=input(prompt)
prompt='total mass of the drug in the bottle (mg)';
m_drug=input(prompt)
display('the concentration is')
concentration=m_drug/v_bottle
display('The volume of concentrated drug in ml is')
drug_concentrated=(t_drug*m_patient)/concentration
display('the volume of saline in ml is')
vol_saline=v_sample-drug_concentrated
OUTPUT:
>> drug
The volume of the sample of the diluted drug that is to be prepared2
v_sample =
2
total amount of the drug to be injected (mg drug/kg body mass)0.0210
t_drug =
0.0210
volume of solution in the drug bottle (mL)30
v_bottle =
30
patient’s body mass (kg)70
m_patient =
70
total mass of the drug in the bottle (mg)294
m_drug =
294
the concentration is
concentration =
9.8000
The volume of concentrated drug in ml is
drug_concentrated =
0.1500
the volume of saline in ml is
vol_saline =
1.8500
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.