midterm: exported figures in png

This commit is contained in:
Claudio Maggioni (maggicl) 2021-05-04 09:49:25 +02:00
parent cbd98658ee
commit 11ae8556f2
4 changed files with 3 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -9,6 +9,7 @@ f1 = (ysym - 4 * xsym^2)^2 + (1 - xsym)^2;
%% 2.4c - Energy function plot
surf_iterates(f1, xs1, -0.25:0.01:1.25, -0.5:0.01:4.25);
exportgraphics(gca,'2-4-energy.png', 'Resolution', 200);
figure;
%% 2.5 - Rosenbrock's function
@ -17,10 +18,12 @@ f2 = (1 - xsym)^2 + 100 * (ysym - xsym^2)^2;
%% 2.5b - Energy function plot
surf_iterates(f2, xs2, -0.25:0.01:1.25, -0.25:0.01:1.25);
exportgraphics(gca,'2-5-energy.png', 'Resolution', 200);
%% 2.5c - Log gradient norms
figure;
semilogy(0:size(gnorms2, 2)-1, gnorms2, '.-k');
exportgraphics(gca,'2-5-gnorms.png', 'Resolution', 200);
%% Helper functions
function surf_iterates(f, xs, xrange, yrange)