create a matrix based on a row distribution
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
pavlos
le 9 Fév 2014
Réponse apportée : Roger Stafford
le 9 Fév 2014
Hello,
Please help me with the following.
Consider a 100x10 matrix A and a 15x10 matrix B.
We also have a distribution i=1,2,...,15 of the rows of A.
For example,
A=[row1;row2;...;row100];
The distribution of the 15 values is random:
distr=[6;14;...;2];
The distr vector is 100x1.
How can we replace the corresponding rows of B to A, based on the distribution?
The new matrix A, called A_new, is also 100x10 and should like this:
A_new=[B(6,:);B(14,:);...;B(2,:)];
The A_new rows are the corresponding rows of B based on the distribution.
Thank you very much.
Best,
Pavlos
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Random Number Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!