Question: 180 2 ENGR 1204 Programming Languages in Engineering MATLAB Lab 4 The objective of this exercise is to minimize the total surface area of a

180 2 ENGR 1204 Programming Languages in Engineering MATLAB Lab 4 The objective of this exercise is to minimize the total surface area of a cylindrical metal can for a given volume, and compare that area to that of a sphere of equal volume. Assume that the volume is equal to 3.1416. For this exercise, first create two user function files: cylinder.m Inputs -radius, height Outputs - volume, arca sphere.m Input - radius Outputs - volume, aren Next create a MATLAB program (script.M file) to perform the following steps: (1) Display table headings for cylinder radius, height, volume and area (2) For radius values of 0.5 to 1 in steps of 0.02 Compute the height resulting in constant volume Call cylinder.m to calculate and return cylinder volume and area Display the results formatted to 4 significant figures. (3) Calculate and display the sphere radius for a volume of . (4) Call sphere.m to calculate, return and display sphere volume and area. Compare the minimum cylinder area to the sphere's area. Formulas Cylinder: volume =ar'h area=2 trh+ar+ar? = 2 ar (r+ h) (sides) (top) (bottom) Sphere: volume =(4/3) ar area = 4 ar
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
