I need help creating a loop for an experiment
Show older comments
I am fairly new to MATLAB and I am having trouble conceptualizing this code. I have an experiment with 25 subjects, where we will be collecting two videos each day for each subject (for 21 days), and will need to randomely select these videos for review over 28 days from this growing pool. I will have to edit some videos, and I need a way to randomely select the videos so that they are not viewed on consecutive days, and not to be viewed more than 3 or 4 times. This is so that videos are not all reviewed early on in the experiment.In other words:
Day 1 - Record 2 events
Day 2 - Record 2 events...
Day 21 - Record two events
The review of the videos is as follows:
Day 2 - Review 1 videos
Day 3- Review 2 videos
Day 4- Review 3 videos
Day 5- Review 4 videos
Days 6- Review 5 videos...
Day 28- Review 5 videos
To reiterate, there will be 42 videos to be recorded, and 125 reviews (1/3 review conditions will be baseline/no review), and I cant have the videos reviewed on consecutive days, or more than 3 or 4 times.
Would it be something like:
videoPool=1:42
subi=1:25
day=1:28
randSel=randi(videopool,1,1)
if videoPool ==
randi(videopool,1,1)
else
or
A=[1 2 ;1 2]
sz=size(A);
x=randi(42,sz)
This is where I am getting lost
4 Comments
two videos each day for each subject (for 21 days)
there will be 42 videos to be recorded,
The only way that can work out is if you mean 42 videos per subject
and 125 reviews
review over 28 days
125 total reviews over all 25 subjects or 125 reviews per subject?
125 reviews over 28 days is
125/28
over 4 reviews per day, including all duplicate reviews. On the first day, a subject records 2 videos, and you have to do 4 reviews, so you need to review each of the two videos twice on the first day, which contradicts the need to not review the same video on consecutive days.
Stephen Huckins
on 5 Oct 2021
Edited: Stephen Huckins
on 5 Oct 2021
Walter Roberson
on 5 Oct 2021
125/28 was reviews per day. 125/42 is average reviews per video.
I see you added schedule information. I will think about it more but have something else to do at the moment.
Stephen Huckins
on 5 Oct 2021
Accepted Answer
More Answers (0)
Categories
Find more on Video Formats and Interfaces in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!