Random multiply by negative one
5 ビュー (過去 30 日間)
古いコメントを表示
Hello, I bootstrapped a 1000 simulation from my data with replacement and now, I would like to randomly multiply it by one or negative one, but I am not sure how to do that.
My initial guess was to do the following: y3=y2*randi([-1,1],22528,1000), but I guess it will generate pseudorandom integers in this range, which includes zero. Any suggestion on how to do this will be highly appreciated.
Thanks
Alma
0 件のコメント
回答 (3 件)
Azzi Abdelmalek
2016 年 2 月 22 日
編集済み: Azzi Abdelmalek
2016 年 2 月 22 日
out=2*randi([0 1],22528,1000)-1
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Random Number Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!