Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
feval(@assignin,'caller','score',2000);
|
2 | Fail |
tic
%urlwrite('http://tinyurl.com/matlab-Knots','Knots_sample.mat')
%urlwrite('http://tinyurl.com/matlab-numKnots','numKnots.m') % Fast numKnots
urlwrite('http://rmatlabtest.appspot.com/testsuite_sample_knots.mat','Knots_sample.mat')
toc
urlwrite('http://rmatlabtest.appspot.com/numKnots.m','numKnots.m') % Fast numKnots
rehash path % Make numKnots.m available
toc
|
3 | Fail |
cases=50;
nKnots=zeros(cases,1);
KnotTime=zeros(cases,1);
load Knots_sample.mat
testsuite=suite; % update
for n=1:cases
a=testsuite(n).a;
xyIn=testsuite(n).xyIn;
wts=testsuite(n).wts;
rng(2,'twister')
time0 = cputime;
xyOut=solver(a,xyIn,wts);
KnotTime(n) = cputime - time0;
if size(unique(xyOut,'rows'),1)<length(wts)
nKnots(n)=Inf; % Points must be unique
else
nKnots(n)=numKnots(xyOut,a);
end
end
for n=1:cases
fprintf('%2i KnotTime(msec) %5i Knots %4i\n',n,floor(KnotTime(n)*1000),nKnots(n))
end
TKnotTime=sum(KnotTime);
fprintf('Sum KnotTime %5i msec\n',floor(TKnotTime*1000))
Tknots=sum(nKnots);;
fprintf('Knot Score %10.2f\n',Tknots)
fprintf('Cody Maximum allowed Elapsed time is approximately 53 seconds\n')
toc
feval( @assignin,'caller','score',min( 2000,Tknots ) );
|
26 Solvers
Is my wife right? Now with even more wrong husband
1241 Solvers
57 Solvers
Calculate the area of a triangle between three points
877 Solvers
Multiples of a Number in a Given Range
214 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!