Hi all,
I have one vector and i wish to repeat the first element of the vector once at the very beginning.
For example:
n = [1 2 3 4 5 6 7 8 9]
to
n = [1 1 2 3 4 5 6 7 8 9]
Thank you all.

 Respuesta aceptada

Birdman
Birdman el 27 de Mzo. de 2020
Editada: Birdman el 27 de Mzo. de 2020

0 votos

[n(1) n]
or
[repmat(n(1),1) n]

Más respuestas (0)

Categorías

Más información sobre Physics en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 27 de Mzo. de 2020

Editada:

el 27 de Mzo. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by