Vector manipulation by changing order or numbers in a vector.

5 次查看(过去 30 天)
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,

采纳的回答

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 CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by