MATLAB: Hey guys, i need help with vector maniuplation

arraysvectors

Hey guys, can someone help me with this?
Create vector ā€œvā€ (begin at -3 and end at 3, step size 1). Create a vector "w" which includes all elements from "v" but multiply all values which are smaller/equal "0" (<0) by 2.

Best Answer

v = -3:1:3
w = v
w(w<0) = w(w<0)*2
Related Question