midterm: exported figures in png
This commit is contained in:
parent
cbd98658ee
commit
11ae8556f2
4 changed files with 3 additions and 0 deletions
BIN
Claudio_Maggioni_midterm/2-4-energy.png
Normal file
BIN
Claudio_Maggioni_midterm/2-4-energy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 142 KiB |
BIN
Claudio_Maggioni_midterm/2-5-energy.png
Normal file
BIN
Claudio_Maggioni_midterm/2-5-energy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 307 KiB |
BIN
Claudio_Maggioni_midterm/2-5-gnorms.png
Normal file
BIN
Claudio_Maggioni_midterm/2-5-gnorms.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
|
@ -9,6 +9,7 @@ f1 = (ysym - 4 * xsym^2)^2 + (1 - xsym)^2;
|
||||||
|
|
||||||
%% 2.4c - Energy function plot
|
%% 2.4c - Energy function plot
|
||||||
surf_iterates(f1, xs1, -0.25:0.01:1.25, -0.5:0.01:4.25);
|
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;
|
figure;
|
||||||
|
|
||||||
%% 2.5 - Rosenbrock's function
|
%% 2.5 - Rosenbrock's function
|
||||||
|
@ -17,10 +18,12 @@ f2 = (1 - xsym)^2 + 100 * (ysym - xsym^2)^2;
|
||||||
|
|
||||||
%% 2.5b - Energy function plot
|
%% 2.5b - Energy function plot
|
||||||
surf_iterates(f2, xs2, -0.25:0.01:1.25, -0.25:0.01:1.25);
|
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
|
%% 2.5c - Log gradient norms
|
||||||
figure;
|
figure;
|
||||||
semilogy(0:size(gnorms2, 2)-1, gnorms2, '.-k');
|
semilogy(0:size(gnorms2, 2)-1, gnorms2, '.-k');
|
||||||
|
exportgraphics(gca,'2-5-gnorms.png', 'Resolution', 200);
|
||||||
|
|
||||||
%% Helper functions
|
%% Helper functions
|
||||||
function surf_iterates(f, xs, xrange, yrange)
|
function surf_iterates(f, xs, xrange, yrange)
|
||||||
|
|
Reference in a new issue