Problem 55760. Reproduce this plot!
Solution Stats
Problem Comments
-
8 Comments
@luxintenebris It's possible for a test suite to include code before the first test; this is run when a solution is evaluated, but isn't shown as part of the tests.
@Christian Schröder In that case, should there be some check that it always runs? Or just include it in the suite? I had to call the function in the scratchpad first before the assertions could be properly handled.
@luxintenebris The "hidden" code should always run since it's part of the test suite as far as the Cody engine is concerned, even if it's not shown on the web frontend.
And yes, this can be annoying because you then can't simply copy tests to the scratchpad to check your solution before submitting. At least in this problem, the hidden code doesn't do anything beyond setting the same variables given in the problem description, and calling the function.
That said when you submit your solution using the scratchpad should never be necessary, hidden test suite code or not.
Solution Comments
Show commentsProblem Recent Solvers149
Suggested Problems
-
Sort a list of complex numbers based on far they are from the origin.
5698 Solvers
-
Find the alphabetic word product
3376 Solvers
-
Longest run of consecutive numbers
5855 Solvers
-
831 Solvers
-
1047 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!