How to present images i random order?
2 次查看(过去 30 天)
显示 更早的评论
采纳的回答
KSSV
2017-4-3
编辑:KSSV
2017-4-3
files = dir('*.jpg') ; % all jp gimages in folder
N = length(files) ; % total files
idx = randperm(N) ; % random order of numbers till N
for i = 1:N % loop for each file
files(idx(i)).name
end
4 个评论
dbmn
2017-4-3
And if you want a random but repeatable sequence you could set the seed for the random number generation before KSSVs script using
rng(1);
This way the sequence is random but you can always reconstruct the exact same sequence using the same seed (in our case 1).
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!