Given two vectors t and y, make a plot containing a blue ( b ) dashed ( -- ) line of y versus t.
Mark the minimum value m of the vector y by adding a point to the plot. This point should be a red star marker, and it must be added after the blue line.
Return the minimum value of y as output m.
why it is failing..i dont understand..it gives no indication why assertions have failed
Hi Asif, the output from the function is expected to be only the minimum value of vector y; whereas your code returns both - the minimum value of y and also the corresponding t. This is causing the last test to fail. I will modify the tests to make it clearer. You should pass the tests if you set m = ymin
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.
523 Solvers
Given an unsigned integer x, find the largest y by rearranging the bits in x
525 Solvers
Back to basics 21 - Matrix replicating
905 Solvers
204 Solvers
Matlab Basics II - Extract last 3 elements of a vector
110 Solvers