MATLAB Answers

I want to perform a function on the values that are on the even positions of my vector

3 views (last 30 days)
I have a vector that begins at 1 and ends at 89 where the spacing between each number is 4. So, it looks like [1,5,9,13,17,...,89]. What is want to do with this vector is mulitply -1 to only the values in an even position of the vector. What I want essentially is [1,-5,9,-13,....-85,89]. How can I go about doing this? Any advice is appreciated. Thank you.

More Answers (0)

Sign in to answer this question.

Translated by