Hey guys, i need help with vector maniuplation

2 次查看(过去 30 天)
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.

采纳的回答

Paolo
Paolo 2018-6-24
v = -3:1:3
w = v
w(w<0) = w(w<0)*2

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by