Cody

# Problem 1325. Special matrix

Solution 927203

Submitted on 25 Jul 2016 by Stephanie O'Neil
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 = 3; y_correct = [1 1 0 1 0 1 0 1 1]; assert(isequal(your_fcn_name(x),y_correct))

y = 1 4 7 2 5 8 3 6 9 y = 1 1 7 1 5 1 3 1 1 y = 1 1 0 1 0 1 0 1 1

2   Pass
x = 4; y_correct = [ 1 1 0 0 1 0 1 0 0 1 0 1 0 0 1 1]; assert(isequal(your_fcn_name(x),y_correct))

y = 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 y = 1 1 9 13 1 6 1 14 3 1 11 1 4 8 1 1 y = 1 1 0 0 1 0 1 0 0 1 0 1 0 0 1 1

3   Pass
x = 5; y_correct = [ 1 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 1]; assert(isequal(your_fcn_name(x),y_correct))

y = 1 6 11 16 21 2 7 12 17 22 3 8 13 18 23 4 9 14 19 24 5 10 15 20 25 y = 1 1 11 16 21 1 7 1 17 22 3 1 13 1 23 4 9 1 19 1 5 10 15 1 1 y = 1 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 1

4   Pass
x = 6; y_correct = [ 1 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 1]; assert(isequal(your_fcn_name(x),y_correct))

y = 1 7 13 19 25 31 2 8 14 20 26 32 3 9 15 21 27 33 4 10 16 22 28 34 5 11 17 23 29 35 6 12 18 24 30 36 y = 1 1 13 19 25 31 1 8 1 20 26 32 3 1 15 1 27 33 4 10 1 22 1 34 5 11 17 1 29 1 6 12 18 24 1 1 y = 1 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 1

5   Pass
x = 18; y_correct = [ 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1]; assert(isequal(your_fcn_name(x),y_correct))

y = Columns 1 through 16 1 19 37 55 73 91 109 127 145 163 181 199 217 235 253 271 2 20 38 56 74 92 110 128 146 164 182 200 218 236 254 272 3 21 39 57 75 93 111 129 147 165 183 201 219 237 255 273 4 22 40 58 76 94 112 130 148 166 184 202 220 238 256 274 5 23 41 59 77 95 113 131 149 167 185 203 221 239 257 275 6 24 42 60 78 96 114 132 150 168 186 204 222 240 258 276 7 25 43 61 79 97 115 133 151 169 187 205 223 241 259 277 8 26 44 62 80 98 116 134 152 170 188 206 224 242 260 278 9 27 45 63 81 99 117 135 153 171 189 207 225 243 261 279 10 28 46 64 82 100 118 136 154 172 190 208 226 244 262 280 11 29 47 65 83 101 119 137 155 173 191 209 227 245 263 281 12 30 48 66 84 102 120 138 156 174 192 210 228 246 264 282 13 31 49 67 85 103 121 139 157 175 193 211 229 247 265 283 14 32 50 68 86 104 122 140 158 176 194 212 230 248 266 284 15 33 51 69 87 105 123 141 159 177 195 213 231 249 267 285 16 34 52 70 88 106 124 142 160 178 196 214 232 250 268 286 17 35 53 71 89 107 125 143 161 179 197 215 233 251 269 287 18 36 54 72 90 108 126 144 162 180 198 216 234 252 270 288 Columns 17 through 18 289 307 290 308 291 309 292 310 293 311 294 312 295 313 296 314 297 315 298 316 299 317 300 318 301 319 302 320 303 321 304 322 305 323 306 324 y = Columns 1 through 16 1 1 37 55 73 91 109 127 145 163 181 199 217 235 253 271 1 20 1 56 74 92 110 128 146 164 182 200 218 236 254 272 3 1 39 1 75 93 111 129 147 165 183 201 219 237 255 273 4 22 1 58 1 94 112 130 148 166 184 202 220 238 256 274 5 23 41 1 77 1 113 131 149 167 185 203 221 239 257 275 6 24 42 60 1 96 1 132 150 168 186 204 222 240 258 276 7 25 43 61 79 1 115 1 151 169 187 205 223 241 259 277 8 26 44 62 80 98 1 134 1 170 188 206 224 242 260 278 9 27 45 63 81 99 117 1 153 1 189 207 225 243 261 279 10 28 46 64 82 100 118 136 1 172 1 208 226 244 262 280 11 29 47 65 83 101 119 137 155 1 191 1 227 245 263 281 12 30 48 66 84 102 120 138 156 174 1 210 1 246 264 282 13 31 49 67 85 103 121 139 157 175 193 1 229 1 265 283 14 32 50 68 86 104 122 140 158 176 194 212 1 248 1 284 15 33 51 69 87 105 123 141 159 177 195 213 231 1 267 1 16 34 52 70 88 106 124 142 160 178 196 214 232 250 1 286 17 35 53 71 89 107 125 143 161 179 197 215 233 251 269 1 18 36 54 72 90 108 126 144 162 180 198 216 234 252 270 288 Columns 17 through 18 289 307 290 308 291 309 292 310 293 311 294 312 295 313 296 314 297 315 298 316 299 317 300 318 301 319 302 320 303 321 1 322 305 1 1 1 y = Columns 1 through 16 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 17 through 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1