carrien / free-speech

Analysis and plotting code for speech neuroimaging experiments.
MIT License
4 stars 5 forks source link

Fix issue where number of perturbation trials is 1 #29

Closed Comeani closed 3 years ago

Comeani commented 3 years ago

I was able to find that when setting up a randomly ordered vector of 0s and 1s, the script was using length(pertPair) instead of size(pertPair,2). This returns the length of pertPair (2 when a matrix, indicating 2 pairs. Also 2 when a vector containing just 1 pair, but the vector's length is 2) and causes an index out of bounds error. Size of the 2nd dimension should always return the correct number of pairs.