How can I randomize the order of a matrix of images
조회 수: 1 (최근 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
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!