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........​........-2​0].

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......!!

Categories

Asked:

on 9 Nov 2013

Edited:

on 9 Nov 2013

Community Treasure Hunt

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

Start Hunting!