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++'}
13 if isempty(LaTeXFilename)
16 fid=fopen(LaTeXFilename,'w');
18 error(['Cannot open file ',LaTeXFilename]);
22 fprintf(fid,'\\begin{tabular}{%s}\n
',ColumnFormat);
23 fprintf(fid,' %s \n
',RowFormat);
26 FFormat=DataFormat{1};
28 fprintf(fid,' %s &
',Header{i});
29 FFormat=sprintf('%s & %s
',FFormat,DataFormat{i+1});
31 fprintf(fid,' %s
',Header{nC});
32 fprintf(fid,' \\\\ %s\n
',RowHeaderFormat);
35 fprintf(fid,FFormat,Data(i,:));
36 fprintf(fid,'\\\\ %s\n
',RowFormat);
39 fprintf(fid,'\\end{tabular}\n
');
42 fprintf(' -> %s\n
',LaTeXFilename);