klabhub / neurostim

Design and run visual neuroscience experiments using Matlab and the Psychophysics Toolbox.
MIT License
5 stars 4 forks source link

Fixed bug in getting block number #216

Closed adammorrissirrommada closed 1 year ago

adammorrissirrommada commented 1 year ago

WARNING: potentially affects someone's existing analysis (unlikely)

The output of parameter.get() includes the block number if requested. There is a bug for the last trial of every block in which the returned block number is actually off by +1. It's due to the use of 'atTrialTime', Inf in the internal (recursive) call to get(), because the block number ticks over before the trial number does in the run() loop. The fix is to just use time zero rather than Inf.