Presenting faces at random without repetition
显示 更早的评论
I need help in presenting a set of images (10 in total, at random without any repetitions. In the files, however, I have a total of 20 images and only certain specific pictures have been decided to be presented. How do I specify such criteria? Also, I tried to insert a specification where each of the pictures will be presented for 2 seconds but could not seem to figure out where shall the code be put at.
The following are the codes that I have written but it does not seem to comply. If there are any correction please do help me.
%loop start for recognition phase
%where my codes actualy START
A = imread('matlabfaces');
B = ['x','y','z'];
C = B(randi(numel(B)));
files = dir('matlabfaces'); %specify again the file location
numberoffiles = length(files); %total amount of files?
randomIndexs = randperm(numberoffiles); %randomise the files
%start loop
for j = 1:numberoffiles
thisFilename = files(randomIndexs(j)).name;
rgbimage = imread('matlabfaces');
image (rgbimage);
axis('image', 'off');
pause(3);
end
sca;
1 个评论
John D'Errico
2022-12-19
编辑:John D'Errico
2022-12-19
Please don't keep on posting the same question. If you don't understand the answer, then say so, and ask for further explanation.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Code Generation for ARM Cortex-M and ARM Cortex-A Processors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!