Cody

# Problem 2687. Find the mode of the given input

Solution 541180

Submitted on 5 Dec 2014
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 = [ 3 3 1 4; 0 0 1 1; 0 1 2 4]; y_correct = 1; assert(isequal(mode_cody(x),y_correct))

Error: Attempted to access A(1,2); index out of bounds because numel(A)=1.

2   Fail
%% x = [ 3 0 1 4; 0 0 1 0; 0 0 2 4]; y_correct = 0; assert(isequal(mode_cody(x),y_correct))

Error: Attempted to access A(1,2); index out of bounds because numel(A)=1.

3   Fail
%% x =eye(5); y_correct = 0; assert(isequal(mode_cody(x),y_correct))

Error: Attempted to access A(1,2); index out of bounds because numel(A)=1.

4   Fail
%% x =eye(5)+2; y_correct = 2; assert(isequal(mode_cody(x),y_correct))

Error: Attempted to access A(1,2); index out of bounds because numel(A)=1.

5   Fail
%% x =ones(5)+1.2; y_correct = 2.2; assert(isequal(mode_cody(x),y_correct))

Error: Attempted to access A(1,2); index out of bounds because numel(A)=1.

6   Fail
%% x =zeros(5)+1.2; y_correct = 1.2; assert(isequal(mode_cody(x),y_correct))

Error: Attempted to access A(1,2); index out of bounds because numel(A)=1.

### Community Treasure Hunt

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

Start Hunting!