Find the area of a disk or circle.
x= radius of the disk.
Rather than using isequal on floating points which is bad practice and forcing the function to round its output to two decimals, you should test that the result is within a certain tolerance of the true value, like so: assert(abs(y_correct-crcl_area(x)) <= 0.01)
Good advice! Floating point math and isequal don't mix well.
why don't you claim "pi"?really hate it.
"pi" works, but currently, solution needs to be rounded off to 2 decimal places.
Would be better to increase the result tolerance.
The numbers are wrong.
Please fix the test suite.
You need to specify that the answer must be rounded to 2 decimal places.
Most nonzero elements in row
Program an exclusive OR operation with logical operators
Back to basics 15 - classes
Calculate the area of a triangle between three points
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
Area of a Square
Area of a triangle
Find the Nth Root of a Given Number
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office