필터 지우기
필터 지우기

Insert values into an array

조회 수: 155 (최근 30일)
Joe Abraham
Joe Abraham 2012년 7월 5일
A = [1 3 5 6 7 13]
I want to insert 0 in the 1st cell resulting in
A=[0 1 3 5 6 7 13]
Thanks

채택된 답변

Walter Roberson
Walter Roberson 2012년 7월 5일
A = [0 A]; %build new array
Or:
A(2:end+1) = A; %shift over and zero
A(1) = 0;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by