Filter löschen
Filter löschen

Attempting to randomly present a set of stimuli

1 Ansicht (letzte 30 Tage)
Kyle Davis
Kyle Davis am 11 Mai 2019
Hi all,
I am currently trying to randomly present a set of stimuli. The stimuli set is 21 images; each image is a different consonant from the alphabet. This stimuli are required to be presented randomly in a loop such that there will be 48 image presentations in one trial.
Although my following code is basic, I have managed to load in the images and get them to be presented one after each other with an interval of .9 seconds between each image.
clear all
imgs=cell(21,1);
imgs{1}= imread('image_1.jpg');
imgs{3}= imread('image_2.jpg');
imgs{2}= imread('image_2.jpg');
imgs{3}= imread('image_3.jpg');
imgs{4}= imread('image_4.jpg');
imgs{5}= imread('image_5.jpg');
imgs{6}= imread('image_6.jpg');
imgs{7}= imread('image_7.jpg');
imgs{8}= imread('image_8.jpg');
imgs{9}= imread('image_9.jpg');
imgs{10}= imread('image_10.jpg');
imgs{11}= imread('image_11.jpg');
imgs{12}= imread('image_12.jpg');
imgs{13}= imread('image_13.jpg');
imgs{14}= imread('image_14.jpg');
imgs{15}= imread('image_15.jpg');
imgs{16}= imread('image_16.jpg');
imgs{17}= imread('image_17.jpg');
imgs{18}= imread('image_18.jpg');
imgs{19}= imread('image_19.jpg');
imgs{20}= imread('image_20.jpg');
imgs{21}= imread('image_21.jpg');
figure;
for idx = 1:length(imgs)
A = imshow(imgs{idx});
pause(.9)
delete(A)
end
This code produces 21 image presentations, one after each other. Does anyone have any ideas of how I can manipulate this code to ensure that I get 48 image presentations, instead of being limited to 21?
I appreaciate any help and guidance anyone can lend me.
Thank you.

Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by