2 % DataFormat={
'$%d$',
'$%d$',
'%.3f',
'%.3f',
'%.3f'}
3 % ColumnFormat=
'|r|r||*{3}{c|}'
5 % RowHeaderFormat=
'\hline \hline';
6 % Header={
'$N$',
'$n_q$',
'Matlab',
'Octave',
'FreeFEM++'}
16 fid=fopen(LaTeXFilename,'w');
18 error(['Cannot open file ',LaTeXFilename]);
21 fprintf(fid,'%%\\documentclass[]{article}\n%%\\begin{document}\n
');
24 fprintf(fid,'\\begin{tabular}{%s}\n
',ColumnFormat);
25 fprintf(fid,' %s \n
',RowFormat);
28 FFormat=DataFormat{1};
30 fprintf(fid,' %s &
',Header{i});
31 FFormat=sprintf('%s & %s
',FFormat,DataFormat{i+1});
33 fprintf(fid,' %s
',Header{nC});
34 fprintf(fid,' \\\\ %s\n
',RowHeaderFormat);
37 fprintf(fid,FFormat,Data(i,:));
38 fprintf(fid,'\\\\ %s\n
',RowFormat);
41 fprintf(fid,'\\end{tabular}\n
');
42 fprintf(fid,'%%\\end{document}
');
45 fprintf(' -> %s\n
',LaTeXFilename);