Is my loop counter correct?
Afficher commentaires plus anciens
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 commentaire
darova
le 29 Mai 2020
It is correct
Réponses (0)
Catégories
En savoir plus sur Timing and presenting 2D and 3D stimuli dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!