Random times for an event to occur.

조회 수: 1 (최근 30일)
Adam Vilanova-Goldstein
Adam Vilanova-Goldstein 2020년 4월 13일
댓글: KALYAN ACHARJYA 2020년 4월 14일
I have an object and I need an event to occur at random intervals between 500-1200 miliseconds. There is an overall duration of 4500 ms, so this needs to loop throughout the total duration. I have the code for the event, but I don't know how to randomize the times at which it occurs. Any help would be amazing!
P.S. This is a psych experiment and I have the psychtoolbox installed.

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 4월 13일
편집: KALYAN ACHARJYA 2020년 4월 13일
Is this? #Hint
tic
while toc<4.5
pause(rand) %Because of random pause, time slots varry
% do here
end
More help: here also here
  댓글 수: 3
Adam Vilanova-Goldstein
Adam Vilanova-Goldstein 2020년 4월 13일
is pause a function?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Timing and presenting 2D and 3D stimuli에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by