diff --git a/matlab/mr_gstep.m b/matlab/mr_gstep.m
index 73f1876648c4814cec1d0d8517dbe14639f3f904..78e27d5495cf2b31c1dbdb8bfec37994f82f41dd 100644
--- a/matlab/mr_gstep.m
+++ b/matlab/mr_gstep.m
@@ -62,7 +62,9 @@ while i<n
         end
         xh1=x;
     end
+    save gstep.mat x h1 f0
 end
 
+save gstep.mat x h1 f0
 
 
diff --git a/matlab/mr_hessian.m b/matlab/mr_hessian.m
index 208b522640c8a293f6b7f7094d6b9b0d8c098e29..99149969f682daf80336388d81ca20c73ec5ddd3 100644
--- a/matlab/mr_hessian.m
+++ b/matlab/mr_hessian.m
@@ -233,3 +233,4 @@ if any(isnan(hessian_mat))
 end
 hh1=h1;
 htol1=htol;
+save hess.mat hessian_mat
\ No newline at end of file