Question: PLEASE CODE ON MATLAB Generate a function file that calculates the volume of a right circular cone Volume = 1 3 r 2 h and

PLEASE CODE ON MATLAB
Generate a function file that calculates the volume of a right circular cone Volume =13r2h and the Surface Area =r(r+h2+r22). Note that according to the figure to the right, r is the base radius and h is the height. Your function must meet the following requirements for full points:
a. Must be a function with 2 inputs (radius and height) and 2 outputs (surface area and volume)
b. The user can input a range of radius values from the
Figure 1-Right Circular Cone with a radius r and a height h when running your function and the user will be required to input a constant height.
i. Design your function so that the radius can be inputted as an array and your height will remain constant. That means you need to do proper index multiplication.
c. The output of volumes and surface areas should be outputted in the Command Window
d. A 31 subplot should be generated that shows:
i. Subplot 1: Only the Surface area is plotted as a function of radius with a constant height the user inputted.
ii. Subplot 2: Only the Volume is Plotted as a function of radius with the same constant height the user inputted.
iii. Subplot 3: Both the surface area and volume as a function of radius on the same figure. Use a constant height for both.
e. The plot must be properly labeled
Should have labels on the x-axis, y-axis, a title, a legend. Decide what units of measurement you want to use (inches, meters, etc).
f. The data points should be unique in style and color
g. Each line of the code should be commented
PLEASE CODE ON MATLAB Generate a function file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!