Cody

# Problem 6. Select every other element of a vector

Solution 854188

Submitted on 21 Mar 2016 by Michael
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))

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

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))
{"ft_lang_label":"__label__en","ft_lang_prob":0.55557954,"math_prob":0.9946589,"size":600,"snap":"2019-35-2019-39","text_gpt3_token_len":192,"char_repetition_ratio":0.13590604,"word_repetition_ratio":0.18292683,"special_character_ratio":0.365,"punctuation_ratio":0.18181819,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9919839,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-08-19T22:20:37Z\",\"WARC-Record-ID\":\"<urn:uuid:e5e27207-87a0-461c-bf69-66e7b3bb1093>\",\"Content-Length\":\"72621\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:433bda7e-9527-4b12-b2d4-3e77582ce7db>\",\"WARC-Concurrent-To\":\"<urn:uuid:09caca39-b20d-4d23-91b2-7ece82de4b66>\",\"WARC-IP-Address\":\"23.13.150.165\",\"WARC-Target-URI\":\"https://nl.mathworks.com/matlabcentral/cody/problems/6-select-every-other-element-of-a-vector/solutions/854188\",\"WARC-Payload-Digest\":\"sha1:BTG4BD3REWTZCFM7DR6EIGWMAR6ZH5U7\",\"WARC-Block-Digest\":\"sha1:A4EDRTGZXP5LO25W26GU35ZA3KNSU7UO\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-35/CC-MAIN-2019-35_segments_1566027315132.71_warc_CC-MAIN-20190819221806-20190820003806-00253.warc.gz\"}"}