%
% PLOTCOEF Scatterplots coefficients from different classes.
%
% PLOTCOEF(coef,class)
%
% Author Adrian Chan
%
% This function generates a scatterplot of the coefficients. This will generate
% 9 subplots. Suplots will be as follows:
%
% 1vs2 1vs3 1vs4
% 2vs3 1vs4 1vs5
% 3vs4 1vs5 1vs6
%
% Inputs
%    coef: array of coefficients - each column belongs to a different class
%                                - each row is a different coefficient.
%    class: designates what class a particular row belongs to
%              needs to be consecutive classes (e.g. 1 to 10)
%
% Outputs
%    none
%
% Modifications
% 00/01/16 AC First created.
function y = plotcoef(coef,class)
figure
ptype = {'r.' 'g.' 'b.' 'y.' 'm.' 'c.' 'k.' 'rx' 'gx' 'bx' 'yx' 'mx' 'cx' 'kx'};
Nptype = size(ptype,2);
for coef1 = 1:3
	for coef2 = 1:3
	   subplot(3,3,coef2+(coef1-1)*3)
		hold on
		for i = min(class):max(class)
			c1 = coef(coef1,find(class == i))';
			c2 = coef(coef1+coef2,find(class == i))';
			plot( c1,c2,ptype{ rem(i,Nptype) + 1 } );
	   end
      title(['Coef ' int2str(coef1) ' vs ' int2str(coef1 + coef2)]);
		hold off
   end   
end
