Cody

Solution 2167467

Submitted on 20 Mar 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
nterms = 10; term0 = randi(10); increment = (-1)^randi(2)*randi(10); correctsequence = term0:increment:term0+(nterms-1)*increment; for position = 1:nterms errorsequence = correctsequence; errorsequence(position) = errorsequence(position) + (-1)^randi(2)*randi(50); [errorposition, truesequence] = find_error(errorsequence); assert(errorposition == position && isequal(truesequence, correctsequence), 'failed test 1 at position %d', position); end

errsq = -35 9 10 11 12 13 14 15 16 17 truesq = 8 9 10 11 11 12 13 14 15 16 17

Output argument "err" (and maybe others) not assigned during call to "find_error". Error in Test1 (line 8) [errorposition, truesequence] = find_error(errorsequence);

2   Fail
nterms = 201; term0 = randi(10); increment = (-1)^randi(2)*randi(10); correctsequence = term0:increment:term0+(nterms-1)*increment; for position = 1:10:nterms errorsequence = correctsequence; errorsequence(position) = errorsequence(position) + (-1)^randi(2)*randi(50); [errorposition, truesequence] = find_error(errorsequence); assert(errorposition == position && isequal(truesequence, correctsequence), 'failed test 2 at position %d', position); end

errsq = Columns 1 through 30 -46 -3 -8 -13 -18 -23 -28 -33 -38 -43 -48 -53 -58 -63 -68 -73 -78 -83 -88 -93 -98 -103 -108 -113 -118 -123 -128 -133 -138 -143 Columns 31 through 60 -148 -153 -158 -163 -168 -173 -178 -183 -188 -193 -198 -203 -208 -213 -218 -223 -228 -233 -238 -243 -248 -253 -258 -263 -268 -273 -278 -283 -288 -293 Columns 61 through 90 -298 -303 -308 -313 -318 -323 -328 -333 -338 -343 -348 -353 -358 -363 -368 -373 -378 -383 -388 -393 -398 -403 -408 -413 -418 -423 -428 -433 -438 -443 Columns 91 through 120 -448 -453 -458 -463 -468 -473 -478 -483 -488 -493 -498 -503 -508 -513 -518 -523 -528 -533 -538 -543 -548 -553 -558 -563 -568 -573 -578 -583 -588 -593 Columns 121 through 150 -598 -603 -608 -613 -618 -623 -628 -633 -638 -643 -648 -653 -658 -663 -668 -673 -678 -683 -688 -693 -698 -703 -708 -713 -718 -723 -728 -733 -738 -743 Columns 151 through 180 -748 -753 -758 -763 -768 -773 -778 -783 -788 -793 -798 -803 -808 -813 -818 -823 -828 -833 -838 -843 -848 -853 -858 -863 -868 -873 -878 -883 -888 -893 Columns 181 through 201 -898 -903 -908 -913 -918 -923 -928 -933 -938 -943 -948 -953 -958 -963 -968 -973 -978 -983 -988 -993 -998 truesq = Columns 1 through 30 2 -3 -8 -13 -13 -18 -23 -28 -33 -38 -43 -48 -53 -58 -63 -68 -73 -78 -83 -88 -93 -98 -103 -108 -113 -118 -123 -128 -133 -138 Columns 31 through 60 -143 -148 -153 -158 -163 -168 -173 -178 -183 -188 -193 -198 -203 -208 -213 -218 -223 -228 -233 -238 -243 -248 -253 -258 -263 -268 -273 -278 -283 -288 Columns 61 through 90 -293 -298 -303 -308 -313 -318 -323 -328 -333 -338 -343 -348 -353 -358 -363 -368 -373 -378 -383 -388 -393 -398 -403 -408 -413 -418 -423 -428 -433 -438 Columns 91 through 120 -443 -448 -453 -458 -463 -468 -473 -478 -483 -488 -493 -498 -503 -508 -513 -518 -523 -528 -533 -538 -543 -548 -553 -558 -563 -568 -573 -578 -583 -588 Columns 121 through 150 -593 -598 -603 -608 -613 -618 -623 -628 -633 -638 -643 -648 -653 -658 -663 -668 -673 -678 -683 -688 -693 -698 -703 -708 -713 -718 -723 -728 -733 -738 Columns 151 through 180 -743 -748 -753 -758 -763 -768 -773 -778 -783 -788 -793 -798 -803 -808 -813 -818 -823 -828 -833 -838 -843 -848 -853 -858 -863 -868 -873 -878 -883 -888 Columns 181 through 202 -893 -898 -903 -908 -913 -918 -923 -928 -933 -938 -943 -948 -953 -958 -963 -968 -973 -978 -983 -988 -993 -998

Output argument "err" (and maybe others) not assigned during call to "find_error". Error in Test2 (line 8) [errorposition, truesequence] = find_error(errorsequence);

Suggested Problems

More from this Author9