diff convergenceTable.m @ 32:ddfb98209aa2

Fixed a bunch of problems regarding convergence and saving solutions
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 29 Sep 2015 09:22:22 +0200
parents ad1a41d135a1
children 6a5e94bb5e13
line wrap: on
line diff
--- a/convergenceTable.m	Mon Sep 28 21:56:02 2015 +0200
+++ b/convergenceTable.m	Tue Sep 29 09:22:22 2015 +0200
@@ -10,7 +10,6 @@
 end
 
 function plainTextTable(methodName, T, orders, m, e, q)
-    description = sprintf('method: %s\nT: %d\n');
 
 
     eW = 0;
@@ -24,6 +23,7 @@
     mW = findFieldWidth('%d',m);
     orderHeaderWidth = eW + qW + 1;
 
+    fprintf('method: %s\nT: %d\n',methodName, T);
 
     % Print order headers
     fprintf(' %*s |',mW,'')
@@ -56,11 +56,17 @@
     for i = 1:length(m)
         fprintf(' %*d |',mW,m(i));
         for j = 1:length(orders)
-            fprintf(' %*.2f %*.2f |', eW, log_e{j}(i), qW, q{j}(i));
+            if i == 1
+                fprintf(' %*.2f %*s |', eW, log_e{j}(i), qW, '');
+            else
+                fprintf(' %*.2f %*.2f |', eW, log_e{j}(i), qW, q{j}(i-1));
+            end
         end
         fprintf('\n');
     end
 
+    fprintf('\n');
+
 end
 
 function latexTable(methodName, T, orders, m, e, q)