Vector manipulation by changing order or numbers in a vector.

4 ビュー (過去 30 日間)
Giuseppe
Giuseppe 2014 年 3 月 24 日
コメント済み: Giuseppe 2014 年 3 月 24 日
I have the vector
a = [4 5 7 8 9 10]
I would like to make a new vector with the second element first and the first element last. How could I do this? Also I would like the same manipulation to occur regardless if the numbers or amount of numbers change.
Thanks,
  1 件のコメント
Giuseppe
Giuseppe 2014 年 3 月 24 日
So example for this vector when manipulated it would be
a = [5 7 8 9 10 4]

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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 3 月 24 日
編集済み: Azzi Abdelmalek 2014 年 3 月 24 日
Edit
a = [4 5 7 8 9 10]
b=circshift(a,[0 -1])

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by