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
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]
thanks a lot

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Operators and Elementary Operations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by