Selecting a random element from a matrix with a range.
古いコメントを表示
I am trying to select a random element from this matrix with a certain range.
d = rand(10)
d(end,randperm(size(d,2), 1))
This creates a 10*10 matrix between 1 and 0. I want to slect a random variable < 0.5 but i am trouble applying this to the code. Any help is much appreciated.
2 件のコメント
Cedric
2017 年 10 月 23 日
There may not be any element < 0.5. How do you define the number of elements that you will pick? What is the purpose?
Shane McNamara
2017 年 10 月 24 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!