(copy of prob 6)

Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, starting with the first.

Examples:

 Input  x = [1 3 2 4 3 5]
 Output y is [1 2 3]

 Input  x = [5 9 3 2 2 0 -1]
 Output y is [5 3 2 -1]

Solution Stats

154 Solutions

110 Solvers

Last Solution submitted on Jul 30, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers110

Suggested Problems

More from this Author52

Problem Tags

Community Treasure Hunt

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

Start Hunting!