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 Comment

Jan
Jan on 24 Apr 2017
Edited: Jan on 24 Apr 2017
Please post the code and the wanted output. Do the curly braces mean, that you work with cell arrays?

Sign in to comment.

 Accepted Answer

Perhaps:
L = 14;
V = -L:L;
or
V = -L:L;
V = V(randperm(numel(V));

More Answers (0)

Categories

Find more on 線形代数 in Help Center and File Exchange

Tags

Asked:

on 24 Apr 2017

Answered:

Jan
on 24 Apr 2017

Community Treasure Hunt

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

Start Hunting!