function [] = plotGauss(mu1,mu2,var1,var2,covar) % %PLOT A 2D Gaussian %This function plots the given 2D gaussian on the current plot. % % For Naive Bayes, remember that the covariance is 0 t = -pi:.01:pi; k = length(t); x = sin(t); y = cos(t); R = [var1 covar; covar var2]; [vv,dd] = eig(R); A = real((2*vv*sqrt(dd))'); z = [x' y']*A; hold on; plot(mu1,mu2,'X'); plot(z(:,1)+mu1,z(:,2)+mu2);