Cody

# Problem 44436. Find the largest number

Solution 1367549

Submitted on 4 Dec 2017
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   Pass
filetext = fileread('largest.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden') assert(isempty(strfind(filetext, 'max')),'max() forbidden') assert(isempty(strfind(filetext, 'min')),'min() forbidden') assert(isempty(strfind(filetext, 'sort')),'sort() forbidden') assert(isempty(strfind(filetext, 'unique')),'unique() forbidden')

2   Fail
a = 4; b = 7; c = 1; d = 6; x_correct = 7; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test2 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

3   Fail
a = 1; b = 1; c = 1; d = 1; x_correct = 1; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test3 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

4   Fail
a = 4; b = 3; c = 2; d = 1; x_correct = 4; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test4 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

5   Fail
a = 1; b = 2; c = 3; d = 4; x_correct = 4; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test5 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

6   Fail
a = 1; b = 1; c = 3; d = 5; x_correct = 5; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test6 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

7   Fail
a = 3; b = 3; c = 2; d = 4; x_correct = 4; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test7 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

8   Fail
a = 2; b = 3; c = 1; d = 6.5; x_correct = 6.5; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test8 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

9   Fail
a = 3; b = 3; c = 3; d = 9; x_correct = 9; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test9 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

10   Fail
a = 5; b = 3; c = 3; d = 9; x_correct = 9; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test10 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

11   Fail
a = 3; b = 3; c = 3; d = 1; x_correct = 3; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test11 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

12   Fail
a = 3; b = 3; c = 9; d = 9; x_correct = 9; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test12 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

13   Fail
a = 3; b = 3; c = 1; d = 1; x_correct = 3; assert(isequal(largest(a, b, c, d),x_correct))

Error using largest Too many input arguments. Error in Test13 (line 3) assert(isequal(largest(a, b, c, d),x_correct))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!