Hi,
I'm having a problem with the SideOutcomePlot. When running my protocol, I surprisingly get the following errors:
Index exceeds matrix dimensions.
Error in SideOutcomePlot (line 101)
Xdata = FutureTrialsIndx; Ydata =
SideList(Xdata);
Error in Test1 (line 106)
SideOutcomePlot(BpodSystem.GUIHandles.OutcomePlot,'update',BpodSystem.Data.nTrials+1,2-TrialTypes,Outcomes)
Error in run (line 96)
evalin('caller', [script ';']);
Error in NewLaunchManager>LaunchProtocol (line 702)
run(ProtocolPath);
Error while evaluating DestroyedObject Callback
%SideOutcomePlot
BpodSystem.ProtocolFigures.OutcomePlotFig = figure('Position', [50 50 1000 163],'name','Outcome plot','numbertitle','off', 'MenuBar', 'none', 'Resize', 'on'); % Create a figure for the outcome plot
BpodSystem.GUIHandles.OutcomePlot = axes('Position', [.075 .3 .89 .6]); % Create axes for the outcome plot
SideOutcomePlot(BpodSystem.GUIHandles.OutcomePlot,'init',2-TrialTypes);
for currentTrial=1:MaxTrials
...
Outcomes = zeros(1,BpodSystem.Data.nTrials);
for x = 1:BpodSystem.Data.nTrials
if ~isnan(BpodSystem.Data.RawEvents.Trial{currentTrial}.States.Reward(1))
Outcomes(currentTrial) = 1;
else
Outcomes(currentTrial) = 3;
end
end
..
SideOutcomePlot(BpodSystem.GUIHandles.OutcomePlot,'update',BpodSystem.Data.nTrials+1,2-TrialTypes,Outcomes)
I added the relevant piece of the code. Somehow, it does not work. For example, when running 100 trials; it automatically stops at 78th trial. In parallel, when running 200 trials, the protocol stops at 178th trial. Do you know what is wrong here?
Thanks