Pick 5 Unique Random Numbers
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Univariate Discrete Distributions en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!