Closed nicobast closed 1 year ago
This code aggregates all saccades across trials of a specific type into one matrix rateRaster{ii}, of which there is one per trial type ii. It loops across trials to do so. The purpose is that you can eventually average the matrix rateRaster{ii} across trials to get the trial-averaged saccade rate function, for a specific trial type.
The error probably indicates that in.startInds (which you need to create yourself) is not in the required format. It should be a cell array with one cell per run of data, and then within each cell an nx2 matrix, where n is the number of trials and the first column contains the trial start time for a given trial (in samples) and the second column contains the trial end time. If you need to see how this should be structured, check the sample data provided and print out in.startInds:
So here there are only two runs (i.e., repetitions) of experimental data. Also check out in.trialTypes in the sampleData to see how to supply the trial indices for different trial types (if there are multiple trial types).
Feel free to let me know if you're still running into issues or if you need help structuring your data.
Thanks, for the fast reply and hint to trialTypes! The transposition of my in.trialTypes did the trick.
Hi,
I try to get your brillant script running on output data from a Tobii Eye-Tracker. I am struggeling with the following code line (174) of dataAnalysis.m:
for trNum = trialNumsPerType{ii} rateRaster{ii}(trNum,1:in.startInds{ff}(trNum,2) - in.startInds{ff}(trNum,1)+1) = saccadeTimeVector2{ii}(in.startInds{ff}(trNum,1):in.startInds{ff}(trNum,2)); end
It throws me the error:
Could you elaborate what the code snippit does and do you have an idea what the error is about?