Please modify the fourth test suite so it reports the duration when the assert fails. My tests say I should pass but Cody is exceeding the time. The method to output information on a failed assert is: assert(duration<2,sprintf('Time used %2.3f\n',duration));
The other thing to do is to remove the ";" from the duration=toc(timer) line. This will allow everyone to see how fast the successful routines take to execute. My self-test times are < 500msec but I don't know Cody's speed. thx
Thanks Richard, your suggestions have been implemented.
I am hoping to stimulate a change to cody where some problems (or all) problems are graded on performance not size. A low size often means an unreadable solution, and people have found enough tricks to make size an irrelevance, anyway.
As per Solution 1539945, the Test Suite has been corrupted for me. For me the first line of the Test Suite appears to read "%%x = [ 0 1 ; 2 3 ] ;", and the correct inputs are not supplied. This may be the same Cody bug that previously affected Problem 970 (& perhaps Problem 1319) and still affects Problem 753.
Timing aspect is neat.
The solution with for is able to solve this problem currently within time. When requesting performance, you should measure the time dynamically, or else you will be forced to adjust the threshold as the years go by and computers evolve.
You should make the timing test dynamic. The current optimally vectorized solution is about 7 or 8 times faster than the default looped solution. You could add a test that confirms at least a 75% time reduction.
Btw, I've sent this solution before submitting the default solution. Since this was pretty fast, I guessed that the default would work too.
Not sure why this is not passing, I've tested time and it completes under 1 second... Anyone have any ideas?
I'm getting the error "While evaluating the solution, the server encountered an error caused by temporary unavailability of MATLAB Service. Wait a few minutes for the MATLAB Service to return, and then rescore." but have been able to submit other answers so I assuming it is not passing?
By vectorized he means y=[..... ] ? Or is it just bugged so this is futile?
There is a serious problem with the Test Suite for this submission to pass!!! —DIV
26–27 May 2018: 2L. Time used = 1.115 seconds in last test case.
See Problem 44655. https://www.mathworks.com/matlabcentral/cody/problems/44655
Consistently, reproducibly getting the following error, "While evaluating the solution, the server encountered an error caused by temporary unavailability of MATLAB Service. Wait a few minutes for the MATLAB Service to return, and then rescore." only for certain array assignments to variable y. See submission code. —DIV
Test Suite has been corrupted. Output from my code is merely echoing the input in each case, which doesn't match the intended input.
20 Sep 2017: 2L. Time used = 2.040 seconds in last test case.
tic toc hack :)
The MATLAB service for this has been unavailable for the past couple of days.
03 Mar 2017: 2L. Time used = 2.341 seconds in last test case.
31 Mar 2016: 2L. Time used = 1.436 seconds in last test case.
17 Apr 2015: 2L. Time used = 3.099 seconds in last test case.
09 Jul 2013 : 2L. Time used = 4.112 seconds in last test case.
29 Dec 2012: 2L. Time used = 4.740 seconds in last test case.
6 Oct 2012: 1L. Time used = 1.226 seconds in last test case.
Fuzzy Logic Toolbox is required for this functioon?
I have it on my System Identification toolbox. There is no clear rule what toolbox functions are admissible. If it works, I guess it is allowed.
02 Oct 2012: 0L. Time used = 0.2666 seconds in last test case.
Thanks, I was unaware of 'detrend'.
How come this fails the first time? Are you just on the limits of the time threshold?
This is almost exactly the same as my 'reference' solution. But later some other people came up with cleaner solutions...
Back to basics 3 - Temp Directory
Test if two numbers have the same digits
Length of a short side
Find the dimensions of a matrix
Find the treasures in MATLAB Central and discover how the community can help you!
Select a Web
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