Question

4. Write a function with header (A, V - myCone (r, h), which outputs the total area A and volume of a cone with base radius r

use matlab and show all codes and work

4. Write a function with header (A, V - myCone (r, h), which outputs the total area A and volume of a cone with base radius r

the question continues from this

4. Write a function with header (A, V - myCone (r, h), which outputs the total area A and volume of a cone with base radius r

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

ANSWER OF QUESTION 4

%-------------AREA AND VOLUME OF CONE FUNCTION--------------------------------------------------------%;
function [A,V] = myCone( r,h )
r=input('Enter the radius of cone :' )
h=input('Enter the height of cone :' )
s=sqrt(h*h+r*r);

% Calculate Area of cone (areaC)
AreaC = [(3.14)*(r*s+r*r)]

% Calculate volume of cone (areaC)
VolumeC = [(1/3)*(3.14)*(r*r*h)]

OUTPUT:

Enter the radius of cone :r = 2
Enter the height of cone :h = 3
AreaC = 35.203
VolumeC = 12.560

ACCORDING TO HOMEWORKLIB POLICY I AM GIVING ANSWER ONLY OF THE QUESTION 1.

PLEASE LIKE MY ANSWER. Thank you so much

Add a comment
Know the answer?
Add Answer to:
use matlab and show all codes and work the question continues from this 4. Write a...
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
  • Problem a (PA4a.java) Write a program to evaluate the area of a triangle given the lengths...

    Problem a (PA4a.java) Write a program to evaluate the area of a triangle given the lengths of its sides using Heron's Formula. Here is an outline: Get the three side lengths from the user (which might have decimal values): a, b, c. Check to ensure that the sides are valid for a triangle. Importantly, the sum of the lengths of any two sides must be larger than the length of the third side (you must check all three sides this...

  • Please use Matlab to solve and show your full codes Write a script file Ask the...

    Please use Matlab to solve and show your full codes Write a script file Ask the user to enter sides of a triangle: a, b, c Check to see if the sides are all greater than 0 If they are: Use the function (triangle) that you created in your last homework problem (HW#5 problemttF) to calculate the area. command Display the results on the screen using fprintf write the results to disk using the fprintf command. If any of the...

  • Write a MATLAB script that reads in three floating point values from the user (a, b...

    Write a MATLAB script that reads in three floating point values from the user (a, b and c), which represent the lengths of three sides of a triangle. Then compute the area of the triangle according to the equation: Area s(s-a)(s- b)(s -e) where s is half of the sum of the three sides, or the average of a, b, & c Hint: look up MATLAB function that prompts read-in values from user

  • Write Python expressions corresponding to the following statements: The length of the hypotenuse in a right...

    Write Python expressions corresponding to the following statements: The length of the hypotenuse in a right triangle whose other two sides have lengths a and b The value of the expression that evaluates whether the length of the above hypotenuse is 5 The area of a disk of radius a The value of the Boolean expression that checks whether a point with coordinates x and y is inside a circle with center (a, b) and radius r

  • #6 Write a Matlab program that finds numerically all the roots (or the zeros) of the...

    #6 Write a Matlab program that finds numerically all the roots (or the zeros) of the algebraic equation below in the interval 1.0 <=x<=3.0: sqrt(log(x^2+1))=x^2*sin(e^x)+2 Part a) Prompt the user to enter a positive integer number n, defined the range 2<=n<=15, and then verify if the number entered lies within the specifications. Your program must allow the user to reenter the number without the need to rerun the program. Part b) Create a user-defined function for the bisection method(see details...

  • 5. Find the e-coordinate of the point on the curve : +3y3 = 3ay where the...

    5. Find the e-coordinate of the point on the curve : +3y3 = 3ay where the tangent is horizontal. Show your work in the PDF version of the test. 7. How many real roots does the equation ! 9x +c=0 have in the interval (-3,0? Hint: use the Mean Value Theorem (Rolle's Theorem). Show your work in the PDF version of the test. A. At most two real roots B. At least one real roots C. No real roots D....

  • 3 8 16 (0 complete) This Q Plot each point and form the triangle ABC. Show...

    3 8 16 (0 complete) This Q Plot each point and form the triangle ABC. Show that the triangle ABC is a right triangle. Find its area. A (-2,11); B (5,7); C ( 1,0) Choose the correct graph below that shows points A, B, C, and triangle ABC. O A. O B. O C. OD. -14 14 Ha Show that the triangle ABC is a right triangle. Select the correct choice below and fill in the answer boxes to complete...

  • Please MATLAB for all coding with good commenting. (20) Consider the function f(x) = e* -...

    Please MATLAB for all coding with good commenting. (20) Consider the function f(x) = e* - 3x. Using only and exactly the four points on the graph off with x-coordinates -1,0, 1 and 2, use MATLAB's polyfit function to determine a 3' degree polynomial that approximates f on the interval (-1, 2]. Plot the function f(x) and the 360 degree polynomial you have determined on the same set of axes. f must be blue and have a dashed line style,...

  • I would like to get answers for this homework as soon as possible . 1. a....

    I would like to get answers for this homework as soon as possible . 1. a. Find the coordinates of the vertex of the quadratic y = 2x2 + 3x – 3. b. Find the maximum and minimum values of 2x2 + 3x – 3 for-25x52. C. Find the exact coordinates of the points where y = 2x² + 3x – 3 cuts the coordinate axes. d. Find the values of k for which 2x2 + 3x - 3 =...

  • 2. (18 pts) Consider an isosceles triangle that has its base on the x-axis. The apex...

    2. (18 pts) Consider an isosceles triangle that has its base on the x-axis. The apex of the triangle is at the point (O.y), where y > 0, and the remaining two vertices are at the points (x, 0) and (-x,0), where x > 0 (see figure). The area of the triangle is 120 in? This triangle lies inside a bigger isosceles triangle that also has its base on the x-axis. The apex of the bigger triangle is at the...

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