How can I gernerate negative value in Vector

I want to making a vactor.
The value of the vector is {-L, -L+1, ..., 0,... L}
I used randperm but this fuction only make {1,2,...,L}

1 comentario

Jan
Jan el 24 de Abr. de 2017
Editada: Jan el 24 de Abr. de 2017
Please post the code and the wanted output. Do the curly braces mean, that you work with cell arrays?

Iniciar sesión para comentar.

 Respuesta aceptada

Jan
Jan el 24 de Abr. de 2017
Perhaps:
L = 14;
V = -L:L;
or
V = -L:L;
V = V(randperm(numel(V));

Más respuestas (0)

Categorías

Más información sobre 線形代数 en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Abr. de 2017

Respondida:

Jan
el 24 de Abr. de 2017

Community Treasure Hunt

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

Start Hunting!