Subscripted assignment dimension mismatch.
Error in training>start_training_Callback (line
97)
class1(:,:,samples_output) = zeros(128, 14,
size(x));
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in training (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
@(hObject,eventdata)training('start_training_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
x = [0;1;0;-1];
y = [1;0;-1;0];
h = EmotivEEG;
h.Run;
for k = 1:samples_output
location={};
s=cell(1,4);
for a = 1:4
location{1} = sprintf('UP');
location{2} = sprintf('RIGHT');
location{3} = sprintf('DOWN');
location{4} = sprintf('LEFT');
n = location{a};
s(a)=strread(sprintf(n),'%s','delimiter','');
end
set(handles.viewer_training,'YTick',[]);
set(handles.viewer_training,'XTick',[]);
scatter(x,y,'filled')
text((x-.1),(y+.2),s,'color',[1,0,0]);
hold on;
for s=1:size(x)
samples_class_text = sprintf('Samples: %s \n Class: %s',num2str(k), num2str(s));
set(handles.current_pos,'String',samples_class_text, 'FontSize', 15);
set(handles.viewer_training,'YTick',[]);
set(handles.viewer_training,'XTick',[]);
scatter(x(s),y(s),400,'MarkerFaceColor',[0 0 0]);
drawnow;
if s == 1
class1(:,:,s) = h.data;
class11(:,:,s) = h.data;
con1 = cat(3, class1(:,:,s), class11(:,:,s));
assignin('base','class1',con1);
elseif s == 2
class2(:,:,s) = h.data;
class22(:,:,s) = h.data;
con2 = cat(3, class2(:,:,s), class22(:,:,s));
assignin('base','class2',con2)
elseif s == 3
class3(:,:,s) = h.data;
class33(:,:,s) = h.data;
con3 = cat(3, class3(:,:,s), class33(:,:,s));
assignin('base','class3',con3)
elseif s == 4
class4(:,:,s) = h.data;
class44(:,:,s) = h.data;
con4 = cat(3, class4(:,:,s), class44(:,:,s));
assignin('base','class4',con4)
end
pause(1);
end
cla;
end
h.delete;