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

 Accepted Answer

Matt Fig
Matt Fig on 29 Nov 2012
Edited: Matt Fig on 29 Nov 2012
V = [6 5 4 3 0 1 2 4 0 0 0]
V = [V(2:end-1) 0]

3 Comments

Matt Fig
Matt Fig on 29 Nov 2012
Edited: Matt Fig on 29 Nov 2012
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]
thanks a lot

Sign in to comment.

More Answers (0)

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Asked:

on 29 Nov 2012

Community Treasure Hunt

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

Start Hunting!