Cody

Solution 2169135

Submitted on 22 Mar 2020 by Mandar Nalavade
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 = [1.000 1.04 0.22 10.1; 2.05 2.33 4.1 1000.31; 5.00010 6.429 7.492 8.0]; y_correct = 4; assert(isequal(find_max_sigdec(x),y_correct))

bt = 0 2 bt = 0 2 4 bt = 0 2 4 2 bt = 0 2 4 2 2 bt = 0 2 4 2 2 3 bt = 0 2 4 2 2 3 2 bt = 0 2 4 2 2 3 2 1 bt = 0 2 4 2 2 3 2 1 3 bt = 0 2 4 2 2 3 2 1 3 1 bt = 0 2 4 2 2 3 2 1 3 1 2 y = 4

2   Pass
N = randi(6,1); x1 = rand(1,100); for k = 1:100 x(1,k) = round(x1(1,k)*10^N)/10^N; end assert(isequal(find_max_sigdec(x), N))

bt = 5 bt = 5 5 bt = 5 5 5 bt = 5 5 5 5 bt = 5 5 5 5 5 bt = 5 5 5 5 5 5 bt = 5 5 5 5 5 5 5 bt = 5 5 5 5 5 5 5 5 bt = 5 5 5 5 5 5 5 5 5 bt = 5 5 5 5 5 5 5 5 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 bt = 5 5 5 5 5 5 5 5 5 5 4 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 bt = 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Column 31 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 32 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 33 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 34 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 35 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 36 5 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 37 5 5 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 38 5 5 5 5 5 5 5 4 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 39 5 5 5 5 5 5 5 4 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 40 5 5 5 5 5 5 5 4 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 41 5 5 5 5 5 5 5 4 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 42 5 5 5 5 5 5 5 4 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 43 5 5 5 5 5 5 5 4 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 44 5 5 5 5 5 5 5 4 5 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 45 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 46 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 47 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 48 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 49 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 50 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 5 5 5 5 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 51 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 5 5 5 5 5 4 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 5 5 5 5 5 5 4 5 5 5 Columns 31 through 52 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 5 5 5 5 5 4 5 bt = Columns 1 through 30 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 5 4 ...

3   Pass
N = randi(6,1); a = rand(5,20); for k = 1:20 for m = 1:5 x(m,k) = round(a(m,k)*10^N)/10^N; end end assert(isequal(find_max_sigdec(x), N))

bt = 4 bt = 4 4 bt = 4 4 4 bt = 4 4 4 4 bt = 4 4 4 4 4 bt = 4 4 4 4 4 4 bt = 4 4 4 4 4 4 4 bt = 4 4 4 4 4 4 4 4 bt = 4 4 4 4 4 4 4 4 4 bt = 4 4 4 4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3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 32 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 33 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 34 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 35 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 36 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 37 4 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 38 4 4 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 39 4 4 4 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 40 4 4 4 4 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 41 4 4 4 4 4 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 42 4 4 4 4 4 4 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 43 4 4 4 4 4 4 4 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 44 4 4 4 4 4 4 4 4 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 45 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 46 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 47 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 48 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 49 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 50 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 51 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 Columns 31 through 52 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 bt = Columns 1 through 30 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 ...

4   Pass
x = 1; assert(isequal(find_max_sigdec(x), 0))

y = 0