How can I randomize the order of a matrix of images
3 次查看(过去 30 天)
显示 更早的评论
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.
回答(1 个)
madhan ravi
2020-8-2
编辑:madhan ravi
2020-8-2
Filenames = compose('image%d.png', 1:4);
Filenames(randperm(numel(Filenames))) % ?
7 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!