Cody

Solution 719633

Submitted on 22 Aug 2015 by Keyur Vachhani
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.8969 0.1419 0.1507 0.3296 0.7063

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

ans = Columns 1 through 17 0.1281 0.1986 0.4539 0.6919 0.5575 0.8392 0.5213 0.5090 0.0246 0.2606 0.7546 0.5692 0.6132 0.7810 0.8737 0.5083 0.3403 Columns 18 through 34 0.8151 0.1374 0.5331 0.4096 0.4674 0.1274 0.5481 0.0027 0.6767 0.5700 0.2324 0.7006 0.8702 0.1128 0.4637 0.0771 0.9602 Columns 35 through 50 0.3123 0.3810 0.0079 0.9362 0.4991 0.1920 0.7679 0.6633 0.7101 0.6282 0.7736 0.3972 0.8000 0.9500 0.4704 0.8822

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