This solution is outdated. To rescore this solution, sign in.
-
3 Comments
I don't understand what is wrong. The output below states that the assertion failed on test 2, but it gives no indication of which assertion failed or what the cause was. I plotted this on my matlab and it produced the plot shown in the problem statement. Please clarify what the error is in my code.
Andrew, I suspect that this is failing the second test because the new plot lines are being plotted over the previous plot (from test 1). It is always a good practice to use 'hold off' (here and in MATLAB, generally) to stop plotting over old plots. Having said that, I will consider adding a 'figure' command to the tests, since Cody does not display the plots and it is difficult to debug this particular problem without seeing the plots.
Pooja, you were correct. Adding the hold off command to the end of the code allowed it to submit successfully. Thank you.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!