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 commentaire

Jan
Jan le 24 Avr 2017
Modifié(e) : Jan le 24 Avr 2017
Please post the code and the wanted output. Do the curly braces mean, that you work with cell arrays?

Connectez-vous pour commenter.

 Réponse acceptée

Jan
Jan le 24 Avr 2017
Perhaps:
L = 14;
V = -L:L;
or
V = -L:L;
V = V(randperm(numel(V));

Plus de réponses (0)

Catégories

En savoir plus sur 線形代数 dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!