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 203265

Submitted on 12 Feb 2013

Incorrect

27Size
Leading solution size is 22.
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
 
%%
XXX = @(z)cos(z);
assert(isequal(wine_tester(XXX),'old wine')) % cos

                    
2
Fail
 
%%
XXX = @(z)sqrt(1-cos(z)^2);
assert(isequal(wine_tester(XXX),'old wine')) % sin
Error: Assertion failed.
3
Fail
 
%%
XXX = @(z)cos(z)^2+10;
assert(isequal(wine_tester(XXX),'new wine')) %
Error: Assertion failed.
4
Fail
 
%%
XXX = @(z)log10(10*z)-1;
assert(isequal(wine_tester(XXX),'old wine')) % log10
Error: Assertion failed.
5
Fail
 
%%
XXX = @(z)sin(log10(z)*0+z);
assert(isequal(wine_tester(XXX),'old wine')) % sin
Error: Assertion failed.
6
Pass
 
%%
XXX = @(z)sin(log10(z));
assert(isequal(wine_tester(XXX),'new wine')) %

                    
7
Pass
 
%%
XXX = @(z)cosd(z);
assert(isequal(wine_tester(XXX),'old wine')) % cosd

                    
8
Fail
 
%%
XXX = @(z)exp(z);
assert(isequal(wine_tester(XXX),'old wine')) % exp
Error: Assertion failed.