function conf = IndDimGaussClassifyN(C1Train,C1Test,C2Train,C2Test) 

C1Train = normalize(C1Train);    %Uncomment these 4 lines to include normalization
C1Test  = normalize(C1Test);
C2Train = normalize(C2Train);
C2Test  = normalize(C2Test);

conf = zeros(2,2);

nC1Tr = size(C1Train,1);
nC1Ts = size(C1Test,1);
d = size(C1Test,2);

nC2Tr = size(C2Train,1);
nC2Ts = size(C2Test,1);

m1 = mean(C1Train);
m2 = mean(C2Train);

v1 = 2*var(C1Train);
v2 = 2*var(C2Train);

V1 = repmat(v1,nC1Ts,1);
V2 = repmat(v2,nC2Ts,1);

const1 = -0.5*sum(log(v1));
const2 = -0.5*sum(log(v2));

result11 = -sum(((C1Test-repmat(m1,nC1Ts,1)).^2)./V1,2 ) + const1;
result21 = -sum(((C2Test-repmat(m1,nC2Ts,1)).^2)./V1,2)  + const1;

result12 = const2-sum(((C1Test-repmat(m2,nC1Ts,1)).^2)./V2,2);
result22 = const2-sum(((C2Test-repmat(m2,nC2Ts,1)).^2)./V2,2);


I = find(result11 < result12);
conf(1,2) = size(I,1);
conf(1,1) = size(find(result11 > result12),1);


I = find(result21 > result22 );
conf(2,1) = size(I,1);
conf(2,2) = size(find(result21 < result22 ),1);

