Problem 1052. Elapsed time is -0.005204 seconds.
Write a function that takes less than zero seconds to execute, as measured using tic and toc. For repeatability, the test case pauses for one second. Overall time elapsed for the test case should therefore be less than one second.
tic pause(1) superfast() toc
Elapsed time is 0.9876 seconds.
Solution Stats
Problem Comments
-
1 Comment
The behavior of the test environment is strange. It doesn't accept syntaxes like
function superfast
...
which my 2014a MATLAB has no problems with. I had to use
y = superfast(x)
even though there is no input or output.
Solution Comments
Show commentsProblem Recent Solvers103
Suggested Problems
-
It dseon't mettar waht oedrr the lrettes in a wrod are.
1645 Solvers
-
"Low : High - Low : High - Turn around " -- Create a subindices vector
525 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
10053 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
998 Solvers
-
Vector of numbers divisible by 3
145 Solvers
More from this Author5
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!