フィルターのクリア

Is my loop counter correct?

1 回表示 (過去 30 日間)
Adam Vilanova-Goldstein
Adam Vilanova-Goldstein 2020 年 5 月 29 日
コメント済み: darova 2020 年 5 月 29 日
I am trying to make a counter to see how many times this if statement is run. based on the way I wrote it, it should run once every 1 - 2 seconds for 4.5 -5.5 seconds (that is the length of the trial.
The loop counter that I wrote keeps spitting out numbers in the 100's.
loop = 0;
while time < BlockRec(trial,6) && keyIsDown && keyChange == false %this is the global loop
TriggerEvent = (1 / BlockRec(trial,3)) * BlockRec(trial,6); %check for timeout of trigger
if GetSecs() >= TriggerEvent %this if statement is what I am trying to count
StartSpeedTime = GetSecs();
TriggerEvent = StartSpeedTime + TriggerEvent;
loop = loop + 1;
BlockRec(trial,11) = loop; % BlockRec(trial,#) is how we record the data
end
.........
Basically I am trying to count how many times the event is triggered.
I can do the math on how many times it's SUPPOSED to happen but I want to double check and make sure that it's actually happening.
Also, I am using the PsychToolBox package.
  1 件のコメント
darova
darova 2020 年 5 月 29 日
It is correct

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

回答 (0 件)

カテゴリ

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