Vector manipulation by changing order or numbers in a vector.

1 visualización (últimos 30 días)
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 comentario
Giuseppe
Giuseppe el 24 de Mzo. de 2014
So example for this vector when manipulated it would be
a = [5 7 8 9 10 4]

Iniciar sesión para comentar.

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 24 de Mzo. de 2014
Editada: Azzi Abdelmalek el 24 de Mzo. de 2014
Edit
a = [4 5 7 8 9 10]
b=circshift(a,[0 -1])

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by