Cody

Solution 2032176

Submitted on 22 Nov 2019 by Peter Wight
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))

y = 0.0254 0.7988 0.3407 0.5824 0.9541

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

y = Columns 1 through 18 0.4752 0.3271 0.8321 0.1896 0.7272 0.7996 0.6777 0.0560 0.1584 0.5160 0.2558 0.3057 0.7119 0.7581 0.8438 0.5002 0.1541 0.4606 Columns 19 through 36 0.1949 0.4008 0.8802 0.7483 0.4155 0.5724 0.0868 0.2986 0.7424 0.0750 0.9374 0.1285 0.7655 0.1595 0.1585 0.6350 0.1500 0.6708 Columns 37 through 50 0.7605 0.7529 0.1746 0.8961 0.9028 0.0636 0.8179 0.9342 0.3528 0.0644 0.0279 0.2423 0.7677 0.3401

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

y = 'Aogiegiaaayafrwy'

Suggested Problems

More from this Author95