How to create a random array from an array
古いコメントを表示
Hello every one
I have a 1x450 array and I want to choose 300 elements of this array randomly and create a new array with random elements
I tried randi and randperm but these two didn't give me the answer I want
What should I use instead
Thanks in advance
2 件のコメント
Dyuman Joshi
2023 年 2 月 16 日
What did you try?
Do you want 300 different indices? or 300 indices with repetitions works?
Jan
2023 年 2 月 16 日
randi creates indices with repetitions, randperm without. If both methods are not working for you, the problem is hidden inside "didn't give me the answer I want". The readers cannot guess, what you have exactly tried and what you want. So please post your code and explain, what you want to change.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Number Theory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!