Cody

Solution 1897701

Submitted on 12 Aug 2019 by Dev Gupta
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))

c = 0 c = 0.4000 c = 4.0000 c = 3.5527e-14 c = 2.2000 c = 2.0000 c = 1.7764e-14 c = 1.0000 c = -3.5527e-14 c = 0.5000 c = 5.0000 c = -1.7764e-13 c = 3.3000 c = 3.0000 c = 7.1054e-14 c = 1.0000 c = -3.5527e-14 c = 3.1000 c = 1.0000 c = -5.4570e-11 c = 1.0000e-03 c = 0.0100 c = 0.1000 c = 1.0000 c = -2.3306e-11 c = 4.2900 c = 2.9000 c = -1.0000 c = 4.9200 c = -0.8000 c = 0

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))

c = 1.3000 c = 3.0000 c = 4.4409e-15 c = 0.7000 c = -3.0000 c = -4.6000 c = -2.3000 c = -1.8000 c = 2 c = 0 c = -1.6000 c = 0.3000 c = 3 c = 0 c = 2.9000 c = -1.0000 c = -4.4000 c = -2.4000 c = -4.2000 c = 1.8000 c = -2.0000 c = 1.7000 c = -3.0000 c = 3.3000 c = 3.0000 c = 2.6645e-14 c = -2.4000 c = -4.4000 c = -0.8000 c = -4.1000 c = -0.8000 c = -0.6000 c = -2.3000 c = -2.3000 c = 2.9000 c = -1.0000 c = 4.7000 c = -3.0000 c = 3.3000 c = 3.0000 c = 2.6645e-14 c = -4.3000 c = 2.5000 c = -5 c = -2.4000 c = -0.4000 c = -1.1000 c = -2.8000 c = 2.7000 c = -3.0000 c = 1.3000 c = 3.0000 c = 4.4409e-15 c = 0.9000 c = -1.0000 c = -0.6000 c = -3.0000 c = 1.2000 c = 2.0000 c = -4.4409e-15 c = -2.7000 c = 4.8000 c = -2.0000 c = 1.6000 c = -4.0000 c = -1.4000 c = -4.3000 c = 2 c = 0 c = 0.2000 c = 2 c = 0 c = -0.4000 c = -4.7000 c = 1.7000 c = -3.0000 c = 1.3000 c = 3.0000 c = 4.4409e-15 c = -4.7000 c = 3 c = 0 c = -1.5000 c = -4.1000 c = 0.1000 c = 1 c = 0 c = 2.7000 c = -3.0000 c = 3.9000 c = -1.0000 c = 2.5000 c = -5 c = 0 c = -4.7000 c = -4.6000 c = -2.6000 c = 2.3000 c = 3.0000 c = 2.6645e-14 c = 3 c = 0 c = -4.4000 c = 4.6000 c = -4.0000 c = 4.1000 c = 1.0000 c = -3.5527e-14 c = 3.6000 c = -4.0000 c = 0.2000 c = 2 c = 0 c = -4.6000 c = -1.7000 c = 1.2000 c = 2.0000 c = -4.4409e-15 c = 3.2000 c = 2.0000 c = 1.7764e-14 c = -5 c = -0.4000 c = 2.2000 c = 2.0000 c = 1.7764e-14 c = 0.6000 c = -4 c = 0.8000 c = -2.0000 c = -3.6000 c = 3.3000 c = 3.0000 c = 2.6645e-14 c = 3.1000 c = 1.0000 c = 8.8818e-15 c = -3.8000 c = 0.9000 c = -1.0000 c = -0.3000 c = -1.5000 c = 4.2000 c = 2.0000 c = 1.7764e-14 c = 3.2000 c = 2.0000 c = 1.7764e-14 c = -0.7000 c = -1.2000 c = 2.1000 c = 1.0000 c = 8.8818e-15 c = -3.7000 c = -1.7000 c = -2.8000 c = 1.2000 c = 2.0000 c = -4.4409e-15 c = 1.2000 c = 2.0000 c = -4.4409e-15 c = -4.5000 c = -0.6000 c = -4.1000 c = -2.7000

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))

c = 4.4000 c = 4.0000 c = 3.5527e-14 c = -1.0000 c = -4.9000 c = 1.6000 c = -4.0000 c = 2.3000 c = 3.0000 c = 2.6645e-14 c = -3.5000 c = -4.7000 c = 2.4000 c = 4.0000 c = -8.8818e-15 c = 4.2000 c = 2.0000 c = 1.7764e-14 c = 0.5000 c = -5 c = 2.3000 c = 3.0000 c = 2.6645e-14 c = 0.2000 c = 2 c = 0 c = -1.8000 c = -3.1000 c = 2.8000 c = -2.0000 c = 4.4000 c = 4.0000 c = 3.5527e-14 c = -1.4000 c = 4 c = 0 c = -4.5000 c = -1.4000 c = 2.2000 c = 2.0000 c = 1.7764e-14 c = -1.8000 c = 2 c = 0 c = -4.7000 c = 1.4000 c = 4.0000 c = 1.7764e-14 c = 4.7000 c = -3.0000 c = -0.9000 c = 0.4000 c = 4 c = 0 c = -0.6000 c = -1.4000 c = -1.5000 c = 4.5000 c = -5 c = 4 c = 0 c = -2.3000 c = -3.0000 c = -4.9000 c = -3.7000 c = -4.5000 c = 3.3000 c = 3.0000 c = 2.6645e-14 c = 0.7000 c = -3.0000 c = 3.3000 c = 3.0000 c = 2.6645e-14 c = 0.9000 c = -1.0000 c = 3.6000 c = -4.0000 c = 2 c = 0 c = 1.6000 c = -4.0000 c = -2.5000 c = -0.1000 c = 0.7000 c = -3.0000 c = 4.8000 c = -2.0000 c = -4.9000 c = -4.6000 c = 0.6000 c = -4 c = 2.4000 c = 4.0000 c = -8.8818e-15 c = 2.1000 c = 1.0000 c = 8.8818e-15 c = -0.8000 c = -3.7000 c = -2.4000 c = -4.4000 c = -1.1000 c = -0.9000 c = -4.2000 c = 4.7000 c = -3.0000 c = -4.8000 c = 2.7000 c = -3.0000 c = -1.6000 c = -4.7000 c = 1.7000 c = -3.0000 c = 1.1000 c = 1.0000 c = 8.8818e-15 c = 0.9000 c = -1.0000 c = 2 c = 0 c = -1.6000 c = 1.8000 c = -2.0000 c = 0.3000 c = 3 c = 0 c = -1.2000 c = 3 c = 0 c = -4.1000 c = 3.9000 c = -1.0000 c = 0.2000 c = 2 c = 0 c = 4.7000 c = -3.0000 c = -0.4000 c = -4.7000 c = 3.8000 c = -2.0000 c = -2.2000 c = -1.0000 c = 1.2000 c = 2.0000 c = -4.4409e-15 c = 4.7000 c = -3.0000 c = -2.3000 c = -1.6000 c = -4 c = -1.9000 c = -3.2000 c = 0.8000 c = -2.0000 c = 4.6000 c = -4.0000 c = 4 c = 0 c = -2.8000 c = 2.2000 c = 2.0000 c = 1.7764e-14 c = 4.9000 c = -1.0000 c = -2.5000 c = 3.2000 c = 2.0000 c = 1.7764e-14 c = 1.8000 c = -2.0000

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

c = 0