function matrixtoCformat2(a)
% format matrixtoCformat(a)
% this function prints out a matrix in C-format so that it can be easily cut and
% pasted into a C file.  
[num_rows,num_columns] = size(a);

fprintf(1,'float %s[%d][%d]={',inputname(1),num_rows,num_columns)
for i=1:num_rows
    fprintf(1,'{');
    for j=1:num_columns
        fprintf(1,'\t%10.10e',a(i,j));
        if j~=num_columns
            fprintf(1,',');
        end
    end
    fprintf(1,'}');
    if i~=num_rows
        fprintf(1,',\n');
    end
end
fprintf(1,'};\n');
