1 A cube is x cm on each side Write Matlab calculator statem
1. A cube is \"x\" cm on each side. Write Matlab calculator statements to determine the radius of a sphere that has the same surface area as the cube and the radius of a sphere that has the same volume as the cube.
2. Given one angle (less than 90 degrees) of a right triangle, and the length of the adjacent side, you can calculate the length of the hypotenuse and opposite side using trigonometric functions.
Create a test table and write Matlab calculator statements to solve the problem
Test Case Sample Data Expected Result (manually calculate) Verified?Solution
1.
cube_side = 10;
cube_surface_area = 6*cube_side*cube_side;
% surface area of sphere = 4*pi*r*r
sphere_radius_sa = sqrt(cube_surface_area/(4*pi))
cube_volume = cube_side*cube_side*cube_side;
% sphere volume = (4*pi*R*R*R)/3
sphere_radius_v = ((cube_volume*3)/(4*pi))^(1/3)
% results
% sphere_radius_sa = 6.9099
