P10-02: Volume of a Barebell An old-fashioned barbell is considered a cylindrica
ID: 3735202 • Letter: P
Question
P10-02: Volume of a Barebell An old-fashioned barbell is considered a cylindrical bar of length LB and radius RB, with a sphere on the each end of radius RS. Here's an image: Write a function BarbellVolume that takes 3 parameters LB, RB, RS and returns the volume of this barbell. All measurements are in inches. Note that MATLAB defnes a variable pi as the value of pi; use this variable in your computations. If you need to raise a value to a power, use MATLAB's exponentiation operator Your Function Save C Reset MATLAB Documentation 1 function volume BarbellVolume (LB, RB, RS) volume 1; 31 endExplanation / Answer
The function definition is given below:
function volume = BarbellVolume(LB, RB, RS)
volume = (2 * 4/3 * pi * RS^3) + (pi * RB^2 * LB);
end
/*Hope this helps. Thanks.*/
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.