Create a random vector only with positive numbers
8 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
Matt J
2022 年 9 月 2 日
編集済み: Matt J
2022 年 9 月 2 日
If you don't care what the distribution is, infinite possible recommendations can be made. You can use a classically non-negative distribution, e.g., rand, poissrnd, randi,...
Or, you can improvise and do things like,
x=randn(1,5).^2
or
x=abs(randn(1,5))
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!