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 件のコメント

Jan
Jan 2017 年 4 月 24 日
編集済み: Jan 2017 年 4 月 24 日
Please post the code and the wanted output. Do the curly braces mean, that you work with cell arrays?

サインインしてコメントする。

 採用された回答

Jan
Jan 2017 年 4 月 24 日

1 投票

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange線形代数 についてさらに検索

タグ

質問済み:

2017 年 4 月 24 日

回答済み:

Jan
2017 年 4 月 24 日

Community Treasure Hunt

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

Start Hunting!