function fid = msmt_write_file(T,filename)
% MSMT_WRITE_FILE writes the decision tree T to the file filename
%
%	fid = msmt_write_file(T,filename)
%
%	T: matrix representing decision tree T generated by MSMT algorithm
%	filename: string containing the desired name of file to write T.
%		NOTE: filename must be string, i.e. filename = 'file1'
%	fid: file identification number.
%
%	NOTE: it is actually the transpose of T that is written

% write
fid = fopen(filename,'w');
fprintf(fid,'%d %d\n',[size(T)]);

for i = 1:size(T,2)
	
	fprintf(fid,'% 8.4g',T(:,i));
	fprintf(fid,'\n');
end
fclose(fid);
