function [inputs, outputs] = getdata();
% gather training data from screen
fprintf('Use the mouse to enter points,\nleft click is class 0, right is class 1 then press any key on keyboard when finished\n');
inputs = [];
outputs = [];
finished = 0;
clf;
axis([0 1 0 1]); % set limits to be between 0,1.
while ~finished
   [x1,y1,class] = ginput(1);
   if class == 1 | class == 3
      inputs = [inputs; [x1 y1]];
      % convert to 0,1 classification
      if class == 3
         class = 1;
      else
         class = 0;
      end
      outputs = [outputs; class];    else
      fprintf('Finished - created %d points',length(outputs));
      finished = 1;
   end
   pos1 = find(outputs==1);
   pos0 = find(outputs==0);
   plot(inputs(pos1,1), inputs(pos1,2),'+',inputs(pos0,1), inputs(pos0,2),'o');
   axis([0 1 0 1]);
end
