Selecting 3 Random Elements from a list Without Repetition
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear All:
I have a row vector of a=[375.7,515.3,432.3,530.7,454.4,490.7,503.4,449.9,509.0,447.2,474.2,398.3,410.6] and I want to select 3 random values for all possible combinations without a repetition.
Could anyone help me with this case? Thanks.
With my best regards,
Mohammed
0 commentaires
Réponse acceptée
KSSV
le 10 Juil 2019
Read about nchoosek.
P = [375.7,515.3,432.3,530.7,454.4,490.7,503.4,449.9,509.0,447.2,474.2,398.3,410.6] ;
idx = nchoosek(1:length(P),3) ;
iwant = P(idx)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices 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!