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.
Matt Fig
Matt Fig 2012 年 11 月 29 日
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 ExchangeOperators 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