Cody

Solution 1925271

Submitted on 7 Sep 2019 by Simon Wittigschlager
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 = rand(1,10); actual = everyOther(x); expected = x(1:2:length(x)); assert(isequal(actual, expected))

ans = 0.6662 0.7735 0.6937 0.9870 0.4502

2   Pass
x = rand(1,100); actual = everyOther(x); expected = x(1:2:length(x)); assert(isequal(actual, expected))

ans = Columns 1 through 18 0.2118 0.3139 0.0160 0.6739 0.4804 0.7150 0.3864 0.2750 0.4890 0.0372 0.2565 0.3278 0.3529 0.7365 0.8789 0.1407 0.6473 0.2706 Columns 19 through 36 0.3716 0.0288 0.0752 0.0311 0.3438 0.0453 0.8976 0.9282 0.8202 0.6847 0.1280 0.7617 0.6348 0.2417 0.5846 0.1193 0.9656 0.1100 Columns 37 through 50 0.2479 0.2961 0.0568 0.6037 0.4357 0.5730 0.9486 0.2373 0.6966 0.0238 0.9900 0.2937 0.6568 0.8410

3   Pass
x = ['A' 'long' 'time' 'ago' 'in' 'a' 'galaxy' 'far' 'far' 'away']; actual = everyOther(x); expected = x(1:2:length(x)); assert(isequal(actual, expected))

ans = 'Aogiegiaaayafrwy'

Suggested Problems

More from this Author95