Pick 5 Unique Random Numbers
古いコメントを表示
I am still trying to learn MATLAB. It would be helpful if I get some knowledge from this problem. So here is a simpler version of my problem. ( I wish to learn from this and use it in my actual problem)
I have Matrix defined by:
A=zeros(10,10);
for i=1:10
for j=1:10
A(j,i)=i*100+j;
end
end
I wish to pick 5 Random but Unique terms in the Matrix A, do some operation (for example: addition of all 5 terms) and from the result, I will make a column Matrix B by populating each row with one result from addition of 5 random unique terms in A, till I run out of all terms in A.
I know how to perform operations on the 5 terms from A and to populate B but I don't know how to get the 5 Random Unique terms from A. Can someone please help me with this.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Univariate Discrete Distributions についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!