Cody

Solution 213919

Submitted on 7 Mar 2013 by Dan
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
%% case 1 VecStart= [10 20 30 40 50 ]; VecEnd = [11 22 33 44 50]; y_correct = [10 11 20 21 22 30 31 32 33 40 41 42 43 44 50]; assert(isequal(vec_colon(VecStart,VecEnd ),y_correct))
ans = 10 11 ans = 10 11 20 21 22 ans = 10 11 20 21 22 30 31 32 33 ans = 10 11 20 21 22 30 31 32 33 40 41 42 43 44 ans = 10 11 20 21 22 30 31 32 33 40 41 42 43 44 50
2   Pass
%% case 2 VecStart= [2 10 5 15 10 5 2 100 ]; VecEnd = [3 10 6 17 12 7 3 102]; y_correct = [2 3 10 5 6 15 16 17 10 11 12 5 6 7 2 3 100 101 102]; assert(isequal(vec_colon(VecStart,VecEnd ),y_correct))
ans = 2 3 ans = 2 3 10 ans = 2 3 10 5 6 ans = 2 3 10 5 6 15 16 17 ans = 2 3 10 5 6 15 16 17 10 11 12 ans = 2 3 10 5 6 15 16 17 10 11 12 5 6 7 ans = 2 3 10 5 6 15 16 17 10 11 12 5 6 7 2 3 ans = Columns 1 through 16 2 3 10 5 6 15 16 17 10 11 12 5 6 7 2 3 Columns 17 through 19 100 101 102
3   Pass
%% case 3 VecStart = [1:10:500]; VecEnd = [10:10:500]; y_correct = [1:500]; assert(isequal(vec_colon(VecStart,VecEnd ),y_correct))
ans = 1 2 3 4 5 6 7 8 9 10 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 20 17 18 19 20 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 30 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 40 33 34 35 36 37 38 39 40 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 50 49 50 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 60 49 50 51 52 53 54 55 56 57 58 59 60 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 64 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Columns 65 through 70 65 66 67 68 69 70 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 64 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Columns 65 through 80 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 64 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Columns 65 through 80 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 Columns 81 through 90 81 82 83 84 85 86 87 88 89 90 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 64 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Columns 65 through 80 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 Columns 81 through 96 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 Columns 97 through 100 97 98 99 100 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 64 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Columns 65 through 80 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 Columns 81 through 96 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 Columns 97 through 110 97 98 99 100 101 102 103 104 105 106 107 108 109 110 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 64 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Columns 65 through 80 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 Columns 81 through 96 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 Columns 97 through 112 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 Columns 113 through 120 113 114 115 116 117 118 119 120 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 64 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Columns 65 through 80 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 Columns 81 through 96 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 Columns 97 through 112 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 Columns 113 through 128 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 Columns 129 through 130 129 130 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 64 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Columns 65 through 80 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 Columns 81 through 96 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 Columns 97 through 112 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 Columns 113 through 128 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 Columns 129 through 140 129 130 131 132 133 134 135 136 137 138 139 140 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 64 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Columns 65 through 80 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 Columns 81 through 96 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 Columns 97 through 112 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 Columns 113 through 128 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 Columns 129 through 144 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 Columns 145 through 150 145 146 147 148 149 150 ans = Columns 1 through 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Columns 17 through 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Columns 33 through 48 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Columns 49 through 64 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Columns 65 through 80 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 Columns 81 through 96 81 82 83 84 85 86 8...