Cody

Solution 2045682

Submitted on 4 Dec 2019 by Samuel Mathukutty
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.2137 0.0325 0.2794 0.1214 0.0599

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.2929 0.7872 0.6963 0.8975 0.6783 0.8547 0.6445 0.4824 0.6736 0.7054 0.9983 0.0818 0.2031 0.8152 0.1451 0.6999 0.4444 0.5842 Columns 19 through 36 0.3025 0.6789 0.9662 0.2046 0.5531 0.8710 0.9921 0.9793 0.9747 0.7740 0.0352 0.4029 0.9139 0.8732 0.7061 0.0706 0.0433 0.5134 Columns 37 through 50 0.0549 0.4077 0.5639 0.2685 0.4772 0.9664 0.3625 0.2753 0.4649 0.2423 0.8405 0.8708 0.7324 0.9727

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'