create a vector which counts down from 200 to 0 by two. How to make every other being negative

47 次查看(过去 30 天)
create a vector which counts down from 200 to 0 by two with every other entry being negative I already can create a vector from 200 to 0 by 2: X= [200:-2:0] How to make every other entry being negative

采纳的回答

KSSV
KSSV 2017-9-1
X= [200:-2:0] ;
X(1:2:end) = -X(1:2:end) ;

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by