function plotdata(input, target)
% function plotdata(input, target)
%
% plot the data by class -- works only for 2D data...
% 
% Assumes the targets are stored one column per class.  When the i'th target
% column is greater than 0 it identifies that row as being an element of 
% class i.

if not(size(input,2) == 2)
  error('Dimension of data is not 2,  sorry.');
end

a = {'rx', 'bo', 'k*', 'ro', 'b*', 'kx'};

numclasses = size(target, 2);

% clf
hold on
for i = 1:numclasses
  select = target(:,i) > 0;
  data = input(select,:);
  plot(data(:,1), data(:,2), char(a(i)));
end
axis equal
hold off 

  