Question

In matlab code

Problem 3 (15 points) The body surface area (BSA) of a person (used for determining dosage of medications can be calculated by the following formula: BSA. 0.007184 W 0.425 H0.75 Write one script file to set up the problem and call all your functions. (a) Write an anonymous function named P3anon that calculates the BSA whose input arguments are Wand H. (b) Write a function file named p3file that calculates the BSA whose input arguments are Wand H. (c) Use both your functions to calculate the BSA of the following people Person A: 95 kg, 1.87 m. Person B: 61 kg, 1.58 m

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a-> Anonymous function to calculate the BSA

  p3anaon=@(w,h)(0.007184*(w^0.425)*h^0.75);

H=input(' ');
W=input(' ');
disp(p3anaon(H,W));

b-> To writa a function in file put this code in the file names P3file.m :

function f = fact(W,H)
f = prod(0.007184*(w^0.425)*h^0.75);
end

c-> BSA of person A using function : 0.28523 (Same when calculated with the file function)

BSA of person B using function : 0.19046 (Same when calculated with the file function)

Add a comment
Know the answer?
Add Answer to:
In matlab code The body surface area (BSA) of a person (used for determining dosage of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MATLAB ONLY!!! PLEASE WRITE IN COMPUTER SO I CAN COPY PASTE!!! ANSWER COMPLETELY, IS ONLY ONE...

    MATLAB ONLY!!! PLEASE WRITE IN COMPUTER SO I CAN COPY PASTE!!! ANSWER COMPLETELY, IS ONLY ONE PROGRAM!!! Body surface Area (Problem 6 Page 249). The body surface area (BSA) in m? of a person (used for determining dosage of medications) can be calculated by the formula (Du Bois formula): BSA = 0.007184 W0.425 H0.75 In which W is the mass in kg and H is the height in cm. Create a GUI to calculate the body surface area (BSA). The...

  • This is a code in MATLAB THE HALCYON DAYS OF ERROR-CHECKING IN ENGR 2060 As usual,...

    This is a code in MATLAB THE HALCYON DAYS OF ERROR-CHECKING IN ENGR 2060 As usual, turn in your Matlab function & script for Problem #1. 1) Write a function that will accept an arbitrary number of input arguments (where the input arguments are n x m real- valued, numerical arrays, where 1 n<oo and 1Srn<㏄). This function will return two values: the number of input arguments given by the user, and b. a. the sum of all the elements...

  • Please show the code necessary, and explanations on MATLAB. Plotting 11) Plot the function y =...

    Please show the code necessary, and explanations on MATLAB. Plotting 11) Plot the function y = sin(x) from x = 0 to 21. 12) Plot the functions y = x2 z = x2 + 2x + 1 from x = 0 to 2 on the same graph. Scripts: Input and Output 13) Write a script (M-file) to read in a message at the command line using the MATLAB input function and then display the message to the Command Window using...

  • answer 4, 5, 6, 7 using matlab Homework 10 1. Write the correct first-line syntax for...

    answer 4, 5, 6, 7 using matlab Homework 10 1. Write the correct first-line syntax for a user defined function that is named Feynman and has input variables q and e, and outputs L and M. (Comment out of this line). 2. Using zeros, ones, and eye commands write the one line syntax to create the following matrix: 00000 01100 01010 01001 3. Write the syntax for the user defined function that calculates the surface area and volume of a...

  • read instructions carefully please matlab only Write a MATLAB function for a BMI calculator that receives the inputs for body weight (lbs)and height (ft) from the user's program, calculates th...

    read instructions carefully please matlab only Write a MATLAB function for a BMI calculator that receives the inputs for body weight (lbs)and height (ft) from the user's program, calculates the BMI using the equation below, displays the BMI category, and outputs the BMI value tothe user's program W (kg) h2 (m2) BMI Display Normal if 18.5 s BMI 25 Display Overweight if 25 s BMI <30 Display Obese if BMI 2 30 Else display underweight So you will create two...

  • Use Matlab code Consider the following function sin(x) Using the following parameters in your functions: -func:...

    Use Matlab code Consider the following function sin(x) Using the following parameters in your functions: -func: the function/equation that you are required to integrate -a, b: the integration limits n: the number of points to be used for the integration I:Integral estimate a) Write a function capable of performing numerical integration of h(x) using the composite trapezoidal rule. Use your function to integration the equation with 9 points. Write a function capable of performing numerical integration of h(x) using the...

  • Topics: User Defined Functions and MATLAB Conditionals A online retailer has hired you to write a...

    Topics: User Defined Functions and MATLAB Conditionals A online retailer has hired you to write a program to calculate the total cost of a customer's order. First, the retailer must enter the name and the price per unit for two different candies. Then, the customer is allowed to order as many units of each of the two candies as they would like. Lastly, an invoice (report) is generated (displayed to the screen) under the following rules: All units up to...

  • MATLAB question: I have written a code to solve for a metals resitance. Here is the...

    MATLAB question: I have written a code to solve for a metals resitance. Here is the problem statement: Part 1 (Algorithms) – due Friday: Think about how you might solve the problem of calculating the resistance of a given group of metals depending on the type of metal, the length of the wire and the area of the wire (if given the diameter only – so you must calculate the area). Write instructions (an algorithm) for a script that behaves...

  • Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture...

    Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture i sent is the first page 5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 tt r) as output argument. Paste the function code below. Paste code here 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. 7. Design an...

  • I want the math lab code for theses problems in a unique way

    I want the math lab code for theses problems in a unique way Theory A projectile is launched from point A up an incline plane that makes an angle of 10 with the horizontal. The mountain is 6,000 m high. Vo 10° Figure 1: Flightpath of a projectile. If we neglect the air resistance, the flight path of a projectile launched at an initial speed vo and an angle θ of departure relative to the horizontal is a parabola (see...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT