I have a matrix a=[1,2,3,4..........,20], Now I want to multiply every other element in a with -1 to get a=[1,-2,3,-4................-20].
9 views (last 30 days)
Show older comments
I have a matrix a=[1,2,3,4..........,20] Now I want to multiply every other element in 'a' with -1 to get a=[1,-2,3,-4................-20]. please help me with this......!!
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Multidimensional Arrays 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!