"Correct" answer does not have enough precision.
You need more test cases, with different values of n. Otherwise it's trivial to defeat the test suite.
I agree with Sean
I agree with Sean and Guillaume. I had to use "y = round(y*10000)/10000;" to get my code to pass the test.
Return a list sorted by number of occurrences
1544 Solvers
Renaming a field in a structure array
749 Solvers
609 Solvers
Given a matrix, swap the 2nd & 3rd columns
546 Solvers
128 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!