function  print_mx(fname,matrix)

no_rows = size(matrix,1);
no_cols = size(matrix,2);

fid = fopen(fname,'w');
header = strcat('<',num2str(no_rows),'> <',num2str(no_cols),'>');

fprintf(fid,'%s',header);
for i=1:no_rows
    fprintf(fid,'\n');
 for j=1:no_cols
    fprintf(fid,'%e ',matrix(i,j));
 end
end
fclose(fid);
