Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 210540

Submitted on 28 Feb 2013 by bartekltg

Correct

66Size
Leading solution size is 16.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
foo=@cosh;
goo=@(x)sqrt(cosh(x)+pi);
winner=[];
for k=1:10; winner(end+1)=race(foo,goo); end
assert(all(winner==1))
t1 =
    0.3029
t2 =
    0.4773
winner =
     1
t1 =
    0.2382
t2 =
    0.4748
winner =
     1
t1 =
    0.2393
t2 =
    0.4746
winner =
     1
t1 =
    0.2372
t2 =
    0.4722
winner =
     1
t1 =
    0.2439
t2 =
    0.4801
winner =
     1
t1 =
    0.2402
t2 =
    0.4814
winner =
     1
t1 =
    0.2370
t2 =
    0.4721
winner =
     1
t1 =
    0.2371
t2 =
    0.4747
winner =
     1
t1 =
    0.2375
t2 =
    0.4732
winner =
     1
t1 =
    0.2366
t2 =
    0.4728
winner =
     1
2
Pass
 
%%
foo=@num2str;
goo=@log10;
winner=[];
for k=1:10; winner(end+1)=race(foo,goo); end
assert(all(winner==2))
t1 =
    2.3236
t2 =
    0.2369
winner =
     2
t1 =
    2.2939
t2 =
    0.2371
winner =
     2
t1 =
    2.3013
t2 =
    0.2375
winner =
     2
t1 =
    2.3064
t2 =
    0.2417
winner =
     2
t1 =
    2.3042
t2 =
    0.2380
winner =
     2
t1 =
    2.3127
t2 =
    0.2419
winner =
     2
t1 =
    2.3098
t2 =
    0.2390
winner =
     2
t1 =
    2.3072
t2 =
    0.2401
winner =
     2
t1 =
    2.2928
t2 =
    0.2371
winner =
     2
t1 =
    2.2976
t2 =
    0.2393
winner =
     2
3
Pass
 
%%
foo=@gamma;
goo=@sign;
winner=[];
for k=1:10; winner(end+1)=race(foo,goo); end
assert(all(winner==1))
t1 =
    0.2241
t2 =
    0.2368
winner =
     1
t1 =
    0.2019
t2 =
    0.2353
winner =
     1
t1 =
    0.2037
t2 =
    0.2359
winner =
     1
t1 =
    0.2030
t2 =
    0.2353
winner =
     1
t1 =
    0.2020
t2 =
    0.2355
winner =
     1
t1 =
    0.2015
t2 =
    0.2331
winner =
     1
t1 =
    0.2035
t2 =
    0.2335
winner =
     1
t1 =
    0.2015
t2 =
    0.2349
winner =
     1
t1 =
    0.2012
t2 =
    0.2327
winner =
     1
t1 =
    0.2033
t2 =
    0.2355
winner =
     1