Cody

Problem 46923. Half the length of the vector

Solution 3281018

Submitted on 19 Oct 2020 by ChrisR
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 = [1 2 3 4 5 6 7 8]; y_correct = [1 3 5 7]; assert(isequal(your_fcn_name(x),y_correct))

2   Pass
x = [1.28 3.26 4.89 6.23 2.22]; y_correct = [1.28 4.89 2.22]; assert(isequal(your_fcn_name(x),y_correct))

3   Pass
x = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17]; y_correct = [1 3 5 7 9 11 13 15 17]; assert(isequal(your_fcn_name(x),y_correct))

Suggested Problems

More from this Author5

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!