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!