Question: Write an anonymous function everyother that takes as input a vector x and returns every other element of x. That is, it returns all the

Write an anonymous function everyother that takes as input a vector x and returns every other element of x. That is, it returns all the odd-numbered elements, starting with the first. Examples: Input x = [1 3 2 4 3 5] Output is [1 2 3] Input x = [5 9 3 2 2 0 -1] Output is [5 3 2 -1] Script C Reset D MATLAB Documentation %% Fill in the rest of the anonymous function Nm everyother = @(x) X 6 N 000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
