%ClassifyDigit: Classify an unknown digit by computing its ditance to a
% set of approximate subspaces representing the digit types 0-9. 
%
% Usage:
%  >> Type = ClassifyDigit( S , TheSubspaces );
%
% where S is a vector representing the unknown digit and TheSubspaces is 
% a cell-array that contains orthogonal bases for the respective subspaces.
%
function [Type]=ClassifyDigit( TheDigit , RefAns , TheSubspaces )

 
 for type=0:9,
     % Extract the subspace corresponding to the digit type.
     Uk=TheSubspaces{type+1};
     
     %
     % Compute distance to subspace and find the minimum distance.
     % Use the function DistanceFromSubspace.
     %
     
      
 end
 
 % At the end Type should be set to the type of digit corresponding to the
 % smallest distance.