How can I randomize the order of a matrix of images
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a 2x2 matrix (four images total, same size) that I need to randomize each time the code is ran. I tried using randperm but I can't seem to get the randomized numbers (1-4) to be indexed to the image file names.
2 commentaires
Réponses (1)
madhan ravi
le 2 Août 2020
Modifié(e) : madhan ravi
le 2 Août 2020
Filenames = compose('image%d.png', 1:4);
Filenames(randperm(numel(Filenames))) % ?
7 commentaires
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!