Cody

Solution 1932379

Submitted on 12 Sep 2019
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 5 2 4 3];n=1; y_correct = [1 3 5 3.5 2 3 4 3.5 3]; assert(isequal(stretch_it_out(x,n),y_correct))

l = 2 y = 1 3 5 l = 1.5000 y = 1.0000 3.0000 5.0000 5.0000 3.5000 2.0000 l = 1 y = 1.0000 3.0000 5.0000 5.0000 3.5000 2.0000 2.0000 3.0000 4.0000 l = 0.5000 y = 1.0000 3.0000 5.0000 5.0000 3.5000 2.0000 2.0000 3.0000 4.0000 4.0000 3.5000 3.0000

Assertion failed.

2   Fail
x = [1 5 2 4 3];n=2; y_correct=[1 2+1/3 3+2/3 5 4 3 2 2+2/3 3+1/3 4 3+2/3 3+1/3 3]; y=abs(stretch_it_out(x,n)-y_correct); assert(max(y)<1e-9)

l = 1.3333 y = 1.0000 2.3333 3.6667 5.0000 l = 1 y = 1.0000 2.3333 3.6667 5.0000 5.0000 4.0000 3.0000 2.0000 l = 0.6667 y = 1.0000 2.3333 3.6667 5.0000 5.0000 4.0000 3.0000 2.0000 2.0000 2.6667 3.3333 4.0000 l = 0.3333 y = 1.0000 2.3333 3.6667 5.0000 5.0000 4.0000 3.0000 2.0000 2.0000 2.6667 3.3333 4.0000 4.0000 3.6667 3.3333 3.0000

Matrix dimensions must agree. Error in Test2 (line 3) y=abs(stretch_it_out(x,n)-y_correct);

3   Fail
k=ceil(5*rand)+1 x=1:k:121 n=k-1; assert(isequal(stretch_it_out(x,n),1:121))

k = 6 x = 1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97 103 109 115 121 l = 1 y = 1 2 3 4 5 6 7 l = 1 y = 1 2 3 4 5 6 7 7 8 9 10 11 12 13 l = 1 y = 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 l = 1 y = 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 35 27 28 29 30 31 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 42 27 28 29 30 31 31 32 33 34 35 36 37 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 49 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 56 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 63 53 54 55 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 70 53 54 55 55 56 57 58 59 60 61 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 77 53 54 55 55 56 57 58 59 60 61 61 62 63 64 65 66 67 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 84 53 54 55 55 56 57 58 59 60 61 61 62 63 64 65 66 67 67 68 69 70 71 72 73 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 90 53 54 55 55 56 57 58 59 60 61 61 62 63 64 65 66 67 67 68 69 70 71 72 73 73 74 75 76 77 78 Column 91 79 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 90 53 54 55 55 56 57 58 59 60 61 61 62 63 64 65 66 67 67 68 69 70 71 72 73 73 74 75 76 77 78 Columns 91 through 98 79 79 80 81 82 83 84 85 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 90 53 54 55 55 56 57 58 59 60 61 61 62 63 64 65 66 67 67 68 69 70 71 72 73 73 74 75 76 77 78 Columns 91 through 105 79 79 80 81 82 83 84 85 85 86 87 88 89 90 91 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 90 53 54 55 55 56 57 58 59 60 61 61 62 63 64 65 66 67 67 68 69 70 71 72 73 73 74 75 76 77 78 Columns 91 through 112 79 79 80 81 82 83 84 85 85 86 87 88 89 90 91 91 92 93 94 95 96 97 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 90 53 54 55 55 56 57 58 59 60 61 61 62 63 64 65 66 67 67 68 69 70 71 72 73 73 74 75 76 77 78 Columns 91 through 119 79 79 80 81 82 83 84 85 85 86 87 88 89 90 91 91 92 93 94 95 96 97 97 98 99 100 101 102 103 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 90 53 54 55 55 56 57 58 59 60 61 61 62 63 64 65 66 67 67 68 69 70 71 72 73 73 74 75 76 77 78 Columns 91 through 120 79 79 80 81 82 83 84 85 85 86 87 88 89 90 91 91 92 93 94 95 96 97 97 98 99 100 101 102 103 103 Columns 121 through 126 104 105 106 107 108 109 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 Columns 31 through 60 27 28 29 30 31 31 32 33 34 35 36 37 37 38 39 40 41 42 43 43 44 45 46 47 48 49 49 50 51 52 Columns 61 through 90 53 54 55 55 56 57 58 59 60 61 61 62 63 64 65 66 67 67 68 69 70 71 72 73 73 74 75 76 77 78 Columns 91 through 120 79 79 80 81 82 83 84 85 85 86 87 88 89 90 91 91 92 93 94 95 96 97 97 98 99 100 101 102 103 103 Columns 121 through 133 104 105 106 107 108 109 109 110 111 112 113 114 115 l = 1 y = Columns 1 through 30 1 2 3 4 5 6 7 7 8 9 10 11 12 13 13 14 15 16 ...

Assertion failed.

4   Fail
x=[1 -1 1 -1 1 -1 1];n=3; y_correct=[1 0.5 0 -0.5 -1 -0.5 0 0.5 1 0.5 0 -0.5 -1 -0.5 0 0.5 1 0.5 0 -0.5 -1 -0.5 0 0.5 1]; assert(isequal(stretch_it_out(x,n),y_correct))

l = 0.5000 y = 1.0000 0.5000 0 -0.5000 -1.0000 l = 0.5000 y = 1.0000 0.5000 0 -0.5000 -1.0000 -1.0000 -0.5000 0 0.5000 1.0000 l = 0.5000 y = 1.0000 0.5000 0 -0.5000 -1.0000 -1.0000 -0.5000 0 0.5000 1.0000 1.0000 0.5000 0 -0.5000 -1.0000 l = 0.5000 y = Columns 1 through 18 1.0000 0.5000 0 -0.5000 -1.0000 -1.0000 -0.5000 0 0.5000 1.0000 1.0000 0.5000 0 -0.5000 -1.0000 -1.0000 -0.5000 0 Columns 19 through 20 0.5000 1.0000 l = 0.5000 y = Columns 1 through 18 1.0000 0.5000 0 -0.5000 -1.0000 -1.0000 -0.5000 0 0.5000 1.0000 1.0000 0.5000 0 -0.5000 -1.0000 -1.0000 -0.5000 0 Columns 19 through 25 0.5000 1.0000 1.0000 0.5000 0 -0.5000 -1.0000 l = 0.5000 y = Columns 1 through 18 1.0000 0.5000 0 -0.5000 -1.0000 -1.0000 -0.5000 0 0.5000 1.0000 1.0000 0.5000 0 -0.5000 -1.0000 -1.0000 -0.5000 0 Columns 19 through 30 0.5000 1.0000 1.0000 0.5000 0 -0.5000 -1.0000 -1.0000 -0.5000 0 0.5000 1.0000

Assertion failed.