フィルターのクリア

How create a random sequence

7 ビュー (過去 30 日間)
pizarro
pizarro 2013 年 11 月 24 日
コメント済み: pizarro 2013 年 11 月 24 日
Hi, I want to create a random sequence of 10 elements with values +- 2.How can i do it?
BR,
José Manuel.
  1 件のコメント
the cyclist
the cyclist 2013 年 11 月 24 日
Do you want only values of -2 and 2, or continuous values uniformly in between, like -1.732 and 0.365?

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

採用された回答

the cyclist
the cyclist 2013 年 11 月 24 日
編集済み: the cyclist 2013 年 11 月 24 日
Just -2 and 2:
R = 4*round(rand(1,10)) - 2;
Continuous:
R = 4*rand(1,10) - 2;
  1 件のコメント
pizarro
pizarro 2013 年 11 月 24 日
Thank you very much, I´m starting to study Matlab from myself.
BR,
José Manuel.

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by