Clear Filters
Clear Filters

array shifting problem, help

3 views (last 30 days)
kelami
kelami on 29 Nov 2012
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
Oops, sorry. Just modify it:
V = [6 5 4 3 0 1 2 4 0 0 0]
V = [V(2:end) 0]
kelami
kelami on 29 Nov 2012
thanks a lot

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!