i think the best thing for this problem would be for you to do the timing in the test suite so that the player only needs to write the code to do the waiting. This will also prevent the user from just outputting the input argument.
You say that the function should return the time to within tol, yet you test for exact equality in the test suite? Why not test using the tol to conform to your description?
I succeeded in making this work in MATLAB, but I can't get it to work for the tests that occur here. From the solution map, it looks like others have the same frustration. Please follow the advice of bmtran and Fig, rewriting the problem so that the requirements are clear and there is not a problem with using tic in the function itself.
Currently the test for this problem demands accuracy to the nearest 1/10 millisecond. I see a number of solutions (including mine) resort to cheating to achieve this. I'm not sure whether it is currently possible to solve this problem without cheating.
Determine whether a vector is monotonically increasing
Replace NaNs with the number that appears to its left in the row.
Whether the input is vector?
Given a window, how many subsets of a vector sum positive
03 - Matrix Variables 1
swap sign sum & multiply castles
Have you seen any Spindromes recently?
Check if any duplicates in your data
old wine in a new bottle?
Find the treasures in MATLAB Central and discover how the community can help you!
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