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

조회 수: 12 (최근 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에서 Dynamic System Models에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by