function labels = feature_classifier(M, fmatrix)
%function labels = feature_classifier(M, fmatrix)
%
% FEATURE_CLASSIFIER -- Performs classification using a generalized multi-class
%                       classifier using the nearest-representative rule
%
% Input Parameters:
%   M        --  Matrix of "best representative" feature vectors, with each
%                row representing a different class
%   fmatrix  --  Matrix containing feature vectors of instances to be
%                classified, with one per row
%
% Output Parameters:
%   labels   --  A vector of integers, one per instance in fmatrix.
%                1 is the class represented by the first row of  M,
%                2 is the class represented by the second row of M, etc.
%

% Define an empty matrix of distances
distances = zeros(size(fmatrix,1),size(M,1));

% Define an empty vector of output labels 
labels = zeros(size(fmatrix,1),1);

% Now, you need to finish the function.  Some hints:
%  1) You should use two nested for loops.  The outer one should loop
%     over the rows of fmatrix (i.e., the instances to be classified)
%     and the inner one should loop over the rows of M (i.e., the
%     representatives for each class)
%  2) For each instance, calculate the distance between it's
%     feature vector and ALL of the class representative vectors.
%     Store the distance between the the nth instance and the mth
%     class representative in 'distances(n,m)'.
%  3) To find the minimum distance, you can use the 'min' command,
%     but remember that you need an integer label.  Alternately, you
%     can just an if statement inside the inner for loop.  Store the 
%     integer label for the nth instance in 'labels(n)'

for instance_num = ?

    for class_num = ?

        
    end

end
