Cody

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

Solution 2798461

Submitted on 6 Aug 2020 by Ramesh Kumar V
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))

z = 2 3 5 m = 13 n = 3 count = [] z1 = [] c = 0 z1 = 2 c = 1 count = 1 c = 0 z1 = 2 3 c = 1 c = 2 c = 3 c = 4 c = 5 count = 1 5 c = 0 z1 = 2 3 5 c = 1 c = 2 c = 3 c = 4 c = 5 c = 6 c = 7 count = 1 5 7 y = 7

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

z = 8 m = 2 n = 1 count = [] z1 = [] c = 0 z1 = 8 c = 1 c = 2 count = 2 y = 2