Cody

# Problem 44270. Assert yourself! Hack the assert function to pass this test.

Solution 1486313

Submitted on 10 Apr 2018
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
x = 'Try this one'; y_correct = rand(1); assert(isequal(assertYourself(x),y_correct))

assert = logical 1

One or more output arguments not assigned during call to "varargout". Error in Test1 (line 3) assert(isequal(assertYourself(x),y_correct))

2   Fail
clear all; x = rand(10); y_correct = rand(1); assertYourself(); assert(isequal(true,false))

assert = logical 1

Assertion failed.

3   Fail
clear all; x = rand(10); y = assertYourself(x,'blah') y_correct = rand(1); assert(isequal(y,y_correct))

assert = logical 1

One or more output arguments not assigned during call to "varargout". Error in Test3 (line 3) y = assertYourself(x,'blah')

4   Fail
clear all; x = randi(26,10); y_correct = rand(1); [v,z]= assertYourself(x,x,x); z; msg = ['That is not even fair! ',char(randi(26,1,10)+'A')] assert(isequal(x,y_correct));

assert = logical 1

One or more output arguments not assigned during call to "varargout". Error in Test4 (line 4) [v,z]= assertYourself(x,x,x);

5   Fail
clear all; [v,z]= assertYourself(); v; assert(false);

assert = logical 1

One or more output arguments not assigned during call to "varargout". Error in Test5 (line 2) [v,z]= assertYourself();