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

 Respuesta aceptada

Matt Fig
Matt Fig el 29 de Nov. de 2012
Editada: Matt Fig el 29 de Nov. de 2012

0 votos

V = [6 5 4 3 0 1 2 4 0 0 0]
V = [V(2:end-1) 0]

3 comentarios

Matt Fig
Matt Fig el 29 de Nov. de 2012
Editada: Matt Fig el 29 de Nov. de 2012
kelami comments:
thank you but with that, right most array data is erased. l want to keep array dimension.
Matt Fig
Matt Fig el 29 de Nov. de 2012
Oops, sorry. Just modify it:
V = [6 5 4 3 0 1 2 4 0 0 0]
V = [V(2:end) 0]
kelami
kelami el 29 de Nov. de 2012
thanks a lot

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de Nov. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by