How can I gernerate negative value in Vector

2 views (last 30 days)
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

Jan
Jan on 24 Apr 2017
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

Community Treasure Hunt

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

Start Hunting!