Cody

# Problem 1118. Colon operator of two vectors

Solution 2050441

Submitted on 8 Dec 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
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))

a = 10 20 30 40 50 11 22 33 44 50 y = 10 11 20 22 30 33 40 44 50 50 y = 10 11 20 22 30 33 40 44 50 50

Assertion failed.

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

a = 2 10 5 15 10 5 2 100 3 10 6 17 12 7 3 102 y = 2 3 10 10 5 6 15 17 10 12 5 7 2 3 100 102 y = 2 3 10 10 5 6 15 17 10 12 5 7 2 3 100 102

Assertion failed.

3   Fail
VecStart = [1:10:500]; VecEnd = [10:10:500]; y_correct = [1:500]; assert(isequal(vec_colon(VecStart,VecEnd ),y_correct))

a = Columns 1 through 29 1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151 161 171 181 191 201 211 221 231 241 251 261 271 281 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 Columns 30 through 50 291 301 311 321 331 341 351 361 371 381 391 401 411 421 431 441 451 461 471 481 491 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 y = 1 10 11 20 21 30 31 40 41 50 51 60 61 70 71 80 81 90 91 100 101 110 111 120 121 130 131 140 141 150 151 160 161 170 171 180 181 190 191 200 201 210 211 220 221 230 231 240 241 250 251 260 261 270 271 280 281 290 291 300 301 310 311 320 321 330 331 340 341 350 351 360 361 370 371 380 381 390 391 400 401 410 411 420 421 430 431 440 441 450 451 460 461 470 471 480 481 490 491 500 y = Columns 1 through 29 1 10 11 20 21 30 31 40 41 50 51 60 61 70 71 80 81 90 91 100 101 110 111 120 121 130 131 140 141 Columns 30 through 58 150 151 160 161 170 171 180 181 190 191 200 201 210 211 220 221 230 231 240 241 250 251 260 261 270 271 280 281 290 Columns 59 through 87 291 300 301 310 311 320 321 330 331 340 341 350 351 360 361 370 371 380 381 390 391 400 401 410 411 420 421 430 431 Columns 88 through 100 440 441 450 451 460 461 470 471 480 481 490 491 500

Assertion failed.