The body surface area (BSA) in m^2 of a person can be caluclated by the formula:
ID: 3569181 • Letter: T
Question
The body surface area (BSA) in m^2 of a person can be caluclated by the formula:
BSA=0.007184*W^0.425*H^0.75
in which W is hte mass in kg and H is the height in cm
Write a MATLAB user-defined function that calcultaes the body surface area. For the function name and arguemnets use BSA=BodySurA(w,h). The input arguements w and h are the mass and height respectively. The output arguemnet BSA is the BSA value. Use the function to calulcate the body surface area of:
a) A 95kg, 1.87m person
b) A 61kj, 1.58m person
You should use function main to write and call functions on the same script file.
Have the program loop twice in order to call the function for both test cases. Print the results using fprintf from within the loop. Do not print inside the function.
Explanation / Answer
function BSA = BodySurA(w,h)
BSA = 0.007184*(w^0.425)*(h^0.75);
end
W = [95 , 61 ];
H = [1.87, 1.58];
for i=1:2
BSA = BodySurA(W(i), H(i));
fprintf('%d. BSA for W=%d and H=%.2f is:%f ',(i), W(i), H(i), BSA);
end
--------------------------------------------
OUTPUT
1. BSA for W=95 and H=1.87 is:0.079576
2. BSA for W=61 and H=1.58 is:0.058093
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.