Question: 2. Write a custom matlab function m-file that takes as its input arguments the radius and length of the cylinder. The function should return the

 2. Write a custom matlab function m-file that takes as its

2. Write a custom matlab function m-file that takes as its input arguments the radius and length of the cylinder. The function should return the surface area and volume of the cylinder as output arguments. (The formulas are SA = 21rL + 20r2, V = ar2L.) Use your function to calculate the surface area and volume of a cylinder with radius 4 and length of 10, and to store those values in two variables within the main workspace. 3. Write an anonymous matlab function that takes as its input argument a one- dimensional array of numbers (a vector) and returns the average of the elements in the array, WITHOUT using the built-in mean function (Hint: use the sum and length functions instead.) Use your function to calculate the average of any numerical vector

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!