Generation of rundon numbers with different scales
2 ビュー (過去 30 日間)
古いコメントを表示
Hello!
I got a vector which is
M= [3.452, 3.235, 5.453, 0.0000045, 0.0000065]
and I want to generate a vector of random values that I can add to M, i.e. every value of the vector has to be about the same orther than the original value.
How could I do that?
Thank you so much
0 件のコメント
回答 (1 件)
the cyclist
2019 年 11 月 5 日
You aren't very specific, but the following will generate random values scaled by the value in M.
r = 0.1*M.*randn(size(M))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!