This MATLAB function has to calculate the volume of a hemisphere placed on top of a cylinder, given valid inputs. It takes the radius of the cylinder and the height of the cylinder as input, and returns the total volume of the hemisphere and the cylinder combined.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers61
Suggested Problems
-
Find the numeric mean of the prime numbers in a matrix.
9134 Solvers
-
Sort a list of complex numbers based on far they are from the origin.
5797 Solvers
-
Project Euler: Problem 10, Sum of Primes
2091 Solvers
-
Calculate the derivative of a polynomial
239 Solvers
-
662 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
@chiarad: Please check the answers in the test suite. I think the solution you submitted computes the correct volumes, but the volumes in the tests are incorrect.
Also, the tests should have an assert statement--something like assert(abs(expectedResult-volume)<1e-6). Otherwise, just about anything will pass.
The test suite has been fixed.