%CreateSubspaces: In order to do the classification we need a subspace
% of dimension k that corresponds to each of the digit types 0-9. Each 
% subspace is a matrix where each column represents one basis vector. 
%
% Usage:
%  >> TheSubspaces = CreateSubspaces( RefSet , k );
%
% where RefSet is the reference digits, k is the desired dimension, and 
% TheSubspaces is a cell-array containing the basis matrices for each type
% of digit. In particular 
%
%  BasisType = TheSubspaces{type+1};
%
% gives the matrix containing the basis vectors for digit with type 0-9.
%
function [TheSubspaces]=CreateSubspaces( RefSet , k )

 TheSubspaces=cell(10); % We have 10 digits. 
 
 for type = 0:9
   
   %  
   % Use ExtractDigits to find all digits of the specific type. Then use 
   % svd() to find the first k basis vectors and store. 
   % 
     
   TheSubspaces{type+1}=Basis;
 end