Random times for an event to occur.

3 ビュー (過去 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?
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 4 月 14 日

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeTiming 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