I'm running some benchtests and testing my protocols atm. What I would like to do is plot an average (over several sessions) performance plot as well as an outcome plot. I would like to extract the data from one subfolder (so for each protocol) and from this, plot averages. However, I cannot get it running in Matlab. Could somebody help me out with this problem?
12-20-2017, 01:45 PM
(This post was last modified: 12-20-2017, 01:48 PM by Josh.)
Data from Bpod sessions are saved to disk, as a .mat file containing a MATLAB struct.
The fields of the struct are:
-nTrials (the number of trials recorded in the session)
-RawEvents (a human-readable data structure, containing timestamps for each trial's state transitions and recorded events)
-RawData (a data structure with a copy of the raw data returned from the state machine; this is an uglier version of same data contained in fields: RawEvents and TrialStartTimestamp)
-TrialStartTimestamp (the time when the trial started as recorded by Bpod's clock) Note: Timestamps in RawEvents are relative to each trial's start
-SettingsFile (the settings file you selected in the launch manager)
Also, any fields your protocol added to BpodSystem.Data are stored as additional fields of the data struct.
To combine data across sessions, you'd write a MATLAB script to iterate across the session files you want to combine, and concatenate their fields into a new "master" struct. Since it's hard to anticipate how user-added fields of BpodSystem.Data are formatted, we left the task of writing this code to the user.
All events (regardless of whether they caused state transitions) are recorded in your data file.