Cody

Solution 2127171

Submitted on 13 Feb 2020
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 = [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))

q = 1×10 cell array {'.04'} {'.22'} {'.1'} {'.05'} {'.33'} {'.1'} {'.31'} {'.0001'} {'.429'} {'.492'} s = 1 s = 1 1 s = 1 1 1 s = 1 1 1 1 s = 1 1 1 1 1 s = 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 ans = 0

Assertion failed.

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

q = 1×100 cell array Columns 1 through 12 {'.559567'} {'.087053'} {'.99103'} {'.513308'} {'.602999'} {'.496542'} {'.388612'} {'.438059'} {'.992455'} {'.961653'} {'.592432'} {'.894874'} Columns 13 through 24 {'.05387'} {'.62435'} {'.075154'} {'.748726'} {'.670682'} {'.93362'} {'.353932'} {'.84485'} {'.419547'} {'.083265'} {'.999235'} {'.871847'} Columns 25 through 36 {'.832824'} {'.340468'} {'.70796'} {'.404409'} {'.29634'} {'.532871'} {'.270467'} {'.870822'} {'.864852'} {'.367381'} {'.403392'} {'.80917'} Columns 37 through 48 {'.003444'} {'.249337'} {'.773027'} {'.76444'} {'.523703'} {'.33274'} {'.225158'} {'.348566'} {'.775309'} {'.947161'} {'.818659'} {'.149014'} Columns 49 through 60 {'.745747'} {'.144609'} {'.214458'} {'.138705'} {'.20218'} {'.743751'} {'.133544'} {'.187618'} {'.915746'} {'.248981'} {'.743978'} {'.666794'} Columns 61 through 72 {'.915544'} {'.681507'} {'.124477'} {'.79432'} {'.762137'} {'.257386'} {'.353043'} {'.244045'} {'.410926'} {'.965664'} {'.211254'} {'.039243'} Columns 73 through 84 {'.377342'} {'.89455'} {'.339638'} {'.420479'} {'.983313'} {'.614362'} {'.63119'} {'.946539'} {'.013337'} {'.591455'} {'.689454'} {'.46121'} Columns 85 through 96 {'.903274'} {'.4147'} {'.42864'} {'.082054'} {'.287951'} {'.094703'} {'.735667'} {'.228192'} {'.19517'} {'.769236'} {'.996214'} {'.092723'} Columns 97 through 100 {'.335456'} {'.840439'} {'.668796'} {'.243119'} s = 1 s = 1 1 s = 1 1 1 s = 1 1 1 1 s = 1 1 1 1 1 s = 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Column 31 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 32 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 33 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 34 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 35 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 36 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 37 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 38 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 39 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 40 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 41 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 42 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 43 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 44 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 45 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 46 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 47 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 48 1 1 ...

Assertion failed.

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

q = 1×96 cell array Columns 1 through 18 {'.1'} {'.7'} {'.6'} {'.8'} {'.3'} {'.5'} {'.8'} {'.4'} {'.2'} {'.5'} {'.9'} {'.5'} {'.5'} {'.8'} {'.1'} {'.1'} {'.5'} {'.3'} Columns 19 through 36 {'.9'} {'.7'} {'.5'} {'.4'} {'.4'} {'.9'} {'.2'} {'.9'} {'.8'} {'.1'} {'.9'} {'.2'} {'.4'} {'.6'} {'.2'} {'.8'} {'.1'} {'.7'} Columns 37 through 54 {'.4'} {'.1'} {'.2'} {'.2'} {'.6'} {'.8'} {'.5'} {'.6'} {'.2'} {'.8'} {'.6'} {'.8'} {'.3'} {'.2'} {'.5'} {'.5'} {'.5'} {'.1'} Columns 55 through 72 {'.9'} {'.5'} {'.6'} {'.3'} {'.1'} {'.7'} {'.1'} {'.4'} {'.7'} {'.6'} {'.2'} {'.3'} {'.5'} {'.4'} {'.3'} {'.8'} {'.9'} {'.8'} Columns 73 through 90 {'.9'} {'.7'} {'.1'} {'.7'} {'.1'} {'.8'} {'.6'} {'.1'} {'.7'} {'.5'} {'.6'} {'.3'} {'.7'} {'.3'} {'.5'} {'.5'} {'.2'} {'.7'} Columns 91 through 96 {'.1'} {'.4'} {'.5'} {'.5'} {'.3'} {'.7'} s = 1 s = 1 1 s = 1 1 1 s = 1 1 1 1 s = 1 1 1 1 1 s = 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1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1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 34 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 35 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 36 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 37 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 38 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 39 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 40 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 41 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 42 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 43 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 44 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 45 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 46 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 47 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 48 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

Assertion failed.

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

q = 0×0 empty cell array

Unrecognized function or variable 's'. Error in find_max_sigdec (line 6) max(s)-1 Error in Test4 (line 2) assert(isequal(find_max_sigdec(x), 0))