Returning negative value of element in vector
Show older comments
Hi!
I need to return every second element in a vector as negative, how do I do it?
for example; v=[1 4 -0.3 0.2 4 7 14 -25 -0.003 245]
should be vnew=[1 -4 -0.3 -0.2 4 -7 14 25 -0.003 -245]
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!