% gm = GMclass(X,Y,cov_type) Train Gaussian classifier
%
% Given a labelled training set (X,Y), this computes the maximum likelihood
% estimator for a Gaussian classifier, namely:
% - The prior probabilities (proportion of each class).
% - The mean vectors (average of each class).
% - The covariance matrices (covariance of each class, suitably averaged when
%   the covariance is shared across classes).
% The result is returned in the GMtools format for a Gaussian mixture, where
% each component corresponds to one class.
% See GMpdf.m for descriptions of some of the arguments below.
%
% In:
%   X: NxD matrix containing N D-dim points rowwise.
%   Y: Nx1 matrix containing the class labels for X (in 1..M).
%   cov_type: covariance type (one of 'F','f','D','d','I','i').
% Out:
%   gm: Gaussian mixture struct.

function gm = GMclass(X,Y,cov_type)

