Move elements of a vector to the rigth.

1 回表示 (過去 30 日間)
Julen Vicente Pipaon
Julen Vicente Pipaon 2021 年 3 月 27 日
Hi.
I want to know how I move all the elements of a vector to the rigth.
For example:
[0 0 0 1 0 0] =====> [0 0 0 0 1 0]
or
[ 1 2 3 4 5] =====> [ 5 1 2 3 4 ]

採用された回答

DGM
DGM 2021 年 3 月 27 日
Try this:
a=[1 2 3 4 5]
b=circshift(a,[0 1])
  1 件のコメント
Julen Vicente Pipaon
Julen Vicente Pipaon 2021 年 3 月 27 日
Thank you so much :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by