% class2col.m
%
% transforms class information into output columns suited for
% neural networks
%
% Example:
% class = [1 1 3 2 1 3]'
% nnout = [1 0 0;
%          1 0 0;
%          0 0 1;
%          0 1 0;
%          1 0 0;
%          0 0 1]

function [nnout, class_names] = class2nnout(class)

l=length(class);
u = unique(class);
nnout=zeros(l,length(u));
for i=1:length(u)
   q=find(class==u(i));
   nnout(q,i)=1;
end
class_names = u;

return;