Write a MATLAB function called bodySurfaceArea that takes tw

Write a MATLAB function called bodySurfaceArea that takes two inputs mass (in kg) and height (in cm) and computes the body surface area (BSA) of a person in m2. BSA can be calculated using the Du Bois formula

For example, the BSA of a person with a height of 187 cm and a mass of 75 kg would be calculated as 2.2759 m2.

Next write a function called bodySurfMat that accepts a 2-column array as input. The first column contains values of mass in kg and the second column contains corresponding heights in meters. Your function must use bodySurfaceArea to compute the corresponding value of BSA for each mass-height pair of values. It should return a 3-column array with the mass, height, and BSA values in the respective columns.

Include help comments and other descriptive comments in both functions, and ensure that they do not accept nonsensical input.

Solution

I tried to find out the formula for DuBois formula I have found one formula but it is not giving the exact output provided by you. Please check the formula once. Except that everything is working well. Here I am providing the code with separate .m files

bodySurfaceArea.m file

function bsa = bodySurfaceArea(h,w)
%The DuBois formula
bsa = 0.20247*(h.^(0.725))*(w.^(0.425));
end

bodySurfMat.m file

function [w,h,bsa] = bodySurfMat(arr)
w = arr(1);
h = arr(2);
%The DuBois formula
bsa = 0.20247*(h.^(0.725))*(w.^(0.425));
end

test.m file

bsa = bodySurfaceArea(187,75)
arr = [187,75];
[m,h,bsa] = bodySurfMat(arr)

Write a MATLAB function called bodySurfaceArea that takes two inputs mass (in kg) and height (in cm) and computes the body surface area (BSA) of a person in m2.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site