Cody

Solution 2189823

Submitted on 3 Apr 2020 by Lubos Smolik
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))

x = 0.5878 0.2127 0.1148 0.5810 0.0117

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

x = Columns 1 through 18 0.5716 0.8647 0.1915 0.0323 0.0837 0.1375 0.1602 0.7302 0.2013 0.9895 0.9265 0.5442 0.5149 0.7962 0.9650 0.2707 0.7466 0.0193 Columns 19 through 36 0.8024 0.3863 0.5258 0.8901 0.8345 0.2799 0.3511 0.1241 0.3585 0.6885 0.9443 0.2062 0.6311 0.0176 0.5599 0.1023 0.4201 0.6585 Columns 37 through 50 0.9749 0.7366 0.0439 0.3164 0.7367 0.7966 0.3565 0.4311 0.4492 0.1539 0.8856 0.1074 0.8229 0.2490

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

x = 'Aogiegiaaayafrwy'

Suggested Problems

More from this Author95