array shifting problem, help

hi, l am new at matlab, probably the question is stupid.
l have an array like
[6 5 4 3 0 1 2 4 0 0 0]
l want to shift this array left but the result must be
[5 4 3 0 1 2 4 0 0 0 0]
l dont want to it be circular shifted.
thank you

 채택된 답변

Matt Fig
Matt Fig 2012년 11월 29일
편집: Matt Fig 2012년 11월 29일

0 개 추천

V = [6 5 4 3 0 1 2 4 0 0 0]
V = [V(2:end-1) 0]

댓글 수: 3

Matt Fig
Matt Fig 2012년 11월 29일
편집: Matt Fig 2012년 11월 29일
kelami comments:
thank you but with that, right most array data is erased. l want to keep array dimension.
Oops, sorry. Just modify it:
V = [6 5 4 3 0 1 2 4 0 0 0]
V = [V(2:end) 0]
kelami
kelami 2012년 11월 29일
thanks a lot

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

태그

질문:

2012년 11월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by