Question: Using MATLAB please solve/answer Write a function that will calculate the volume of a barbell made of two spheres connected by a bar. You will
Write a function that will calculate the volume of a barbell made of two spheres connected by a bar. You will pass the radius of the spheres, the radius of the cylinder and the length of the cylinder. Write a program (script) that inputs the radius of the spheres, the radius of the cylinder and the length of the cylinder and calls the function to calculate the volume. Display the result in the script as "The volume of a barbell with two spheres of xx.x radius and a bar of length xx.x with radius of x.xx is xxx.xx." Volume of sphere = 4/3*pi*r' Volume of cylinder = pi*r'*height
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
