Cody

Solution 2191363

Submitted on 3 Apr 2020 by RobNik
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.6407 0.0188 0.7380 0.8595 0.3967

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.8446 0.6217 0.0805 0.5943 0.6084 0.9573 0.1562 0.1965 0.6803 0.2075 0.6798 0.8200 0.8431 0.5001 0.1921 0.8081 0.0840 0.6072 Columns 19 through 36 0.9271 0.8427 0.6482 0.3265 0.8111 0.7080 0.9641 0.9437 0.6363 0.1991 0.8804 0.6265 0.6966 0.8086 0.3755 0.7427 0.4624 0.7964 Columns 37 through 50 0.6694 0.6231 0.5753 0.4145 0.6950 0.4013 0.2606 0.0110 0.5608 0.6609 0.0246 0.3562 0.5925 0.3154

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