Question: b: Define a function that computes the corresponding volume rounded to the nearest tenth of a gallon. Define your function in the functions sections. function

b: Define a function that computes the corresponding volume rounded to the nearest tenth of a gallon. Define your function in the functions sections.
function Vol = compute_vol (h,l,r)
Vol =**r???2**h2;
Vol =round(Vol**0.26417,1);
end
c. To study the effect of height h on the volume, plot the volume against the vector h defined in Task 1. Assume length is 36 in. and the radius is 14
in.
l=36
Function definitions in a script must appear at the end of the file.
Move all statements after the "compute_vol" function definition to before the first local function definition.
r=14
Vol = compute_Voume (h,l,r)
, volume)
xlabel('Height (in)')
ylabel('Volume (gallons)')
title('Volume of Half Cylinder vs. Height')
grid on|
Functions:
For Task 2:
function Vol = compute_volume (h,r,l)
Vol =**r???2**h2;
MATLAB Vol_in_gallons = Vol ** gallons_per_cubic_inch;
rounded_Vol = round (Vol_in_gallons, 1);
Vol = rounded_Vol;
"Vol" found
Zoom: 100%
UTF-8
LF
 b: Define a function that computes the corresponding volume rounded to

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 Databases Questions!