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!