Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a Matlab function called Sphere that takes one input argument: radius and

ID: 3685482 • Letter: C

Question

Create a Matlab function called Sphere that takes one input argument: radius and returns two output arguments: Volume and surface_area of a sphere. Recall, V = 4/3 pi^3 and SA = 4pi^2. Use your function to determine the volume and surface area of a sphere with radius 5 cm. Copy and paste your function code, and screenshots of calling it from the command window and is results. Do NOT use f print in the functions except for checking number of input arguments

Explanation / Answer

function [Volume,SurfaceArea] =calculate_vol_surface_area(Radius,Angle) # this function calculates the area and surface area of sphere in python using the radius and angle passed as arguement. Proportion = Angle/360; if Angle == 360; Volume = (4/3)*pi*(Radius)^3; SurfaceArea = 4*pi*Radius^2; elseif Angle > 0 && Angle < 360; Volume = Proportion*(4/3)*pi*Radius^3; SurfaceArea = (Proportion*4*pi*Radius^2)+(pi*Radius^2); endif endif end function