0001 function exportStatsToLatexTabular(stats, outFile)
0002
0003 methods = {'Nearest', 'Delaunay', 'Natural', 'IDW', 'Kriging', 'MLS', ...
0004 'RBF.linear', 'RBF.cubic', 'RBF.quintic', 'RBF.multiquadric', 'RBF.thinplate', 'RBF.green', 'RBF.tensionspline', 'RBF.regularizedspline', 'RBF.gaussian', 'RBF.wendland', ...
0005 'QTPURBF.linear', 'QTPURBF.cubic', 'QTPURBF.quintic', 'QTPURBF.multiquadric', 'QTPURBF.thinplate', 'QTPURBF.green', 'QTPURBF.tensionspline', 'QTPURBF.regularizedspline', 'QTPURBF.gaussian', 'QTPURBF.wendland'};
0006
0007 fid = fopen(outFile, 'w');
0008 if fid < 0
0009 error('Cannot open output file for writing');
0010 end
0011
0012
0013 fprintf(fid, '\\begin{tabular}{|c|c|c|c|}\n');
0014 fprintf(fid, '\\hline\n');
0015 fprintf(fid, '\\multicolumn{2}{c}{\\textbf{Method}} & \\textbf{Mean Error} & \\textbf{Run Time}\n');
0016 fprintf(fid, '\\hline\n');
0017
0018
0019 for i = 1:numel(methods)
0020 splMethod = regexp(methods{i}, '\.', 'split');
0021 if numel(splMethod) == 1
0022
0023 fprintf(fid, '\\multicolumn{2}{c}{%s} & %s & %s\n', splMethod{1}, stats.(splMethod{1}).meanAbsDiff, stats.(splMethod{1}).meanRunTime);
0024 else
0025
0026 fprintf(fid, '%s & %s & %s & %s\n', splMethod{1}, splMethod{2}, stats.(splMethod{1}).(splMethod{2}).meanAbsDiff, stats.(splMethod{1}).(splMethod{2}).meanRunTime);
0027 end
0028 fprintf(fid, '\\hline\n');
0029 end
0030 fprintf(fid, '\\end{tabular}\n');
0031 fclose(fid);