Skip to content
Snippets Groups Projects
Commit 761d41d5 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

A test with one minimum

parent bc538975
No related branches found
No related tags found
No related merge requests found
if exist('graphics_toolkit','file')
graphics_toolkit('fltk')
end
A = [4 1.5; 1.5 3];
b = [1; 2];
f = @(x) x + (x > 1) .* (x - 1);
phi = @(x) f(norm(x,2));
J = @(x) .5*dot(A*x,x) - dot(b,x) + phi(x);
scale = 1.0;
t = -5:0.1:5;
x = scale*cos(t);
y = scale*sin(t);
z = arrayfun(@(vec1, vec2) J([vec1; vec2]), x, y);
hold on
plot3(x,y,z);
title 'scale = 1'
# Minimum taken from test-circle.cc with scale=1
plot3(-1.487905e-01, +9.888687e-01, J([-1.487905e-01; +9.888687e-01]), 'r+');
hold off
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment