BrainardLab / OneLightToolbox

Brainard Lab code for talking to our OneLight boxes
MIT License
1 stars 0 forks source link

Hotfix stateTrackingData empty struct #42

Closed JorisVincent closed 6 years ago

JorisVincent commented 6 years ago

Tracking state data in several routines produces a struct with state tracking data. However, when not actually tracking state data (simulated, or flag set to false), this code returns an 1x1 struct array, the result of struct().

The problem with this behavior is that isEmpty( struct() ) returns false, since it is an 1x1 struct array, even if it has no fields. Instead, we want to pass back the empty struct array struct([]). This hotfix takes care of that.