Cody

# Problem 44671. find number of times of occurrence of the most frequent number in a row vector

Solution 2078621

Submitted on 3 Jan 2020 by Laura Gialloreto
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
x =[2 3 3 3 5 3 3 5 5 5 5 5 5]; y_correct = 7; assert(isequal(num_mode(x),y_correct))

k = 1×0 empty double row vector n = 0 c = 0 k = 1×0 empty double row vector n = 0 c = 0 0 k = 1 n = 1 c = 0 0 1 k = 2 3 4 6 7 n = 5 c = 0 0 1 5 k = 1×0 empty double row vector n = 0 c = 0 0 1 5 0 k = 5 8 9 10 11 12 13 n = 7 c = 0 0 1 5 0 7 k = 1×0 empty double row vector n = 0 c = 0 0 1 5 0 7 0 k = 1×0 empty double row vector n = 0 c = 0 0 1 5 0 7 0 0 k = 1×0 empty double row vector n = 0 c = 0 0 1 5 0 7 0 0 0 k = 1×0 empty double row vector n = 0 c = 0 0 1 5 0 7 0 0 0 0 y = 7

2   Pass
x =[8 8]; y_correct = 2; assert(isequal(num_mode(x),y_correct))

k = 1×0 empty double row vector n = 0 c = 0 k = 1×0 empty double row vector n = 0 c = 0 0 k = 1×0 empty double row vector n = 0 c = 0 0 0 k = 1×0 empty double row vector n = 0 c = 0 0 0 0 k = 1×0 empty double row vector n = 0 c = 0 0 0 0 0 k = 1×0 empty double row vector n = 0 c = 0 0 0 0 0 0 k = 1×0 empty double row vector n = 0 c = 0 0 0 0 0 0 0 k = 1×0 empty double row vector n = 0 c = 0 0 0 0 0 0 0 0 k = 1 2 n = 2 c = 0 0 0 0 0 0 0 0 2 k = 1×0 empty double row vector n = 0 c = 0 0 0 0 0 0 0 0 2 0 y = 2