summaryrefslogtreecommitdiff
path: root/tests/general_tests/intfminunc/rosenbrock.sce
blob: a2569a70d1879833a5753b86fc70a2d810a3903f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function y=rosenbrock(x)
y=0;
sum=0;
for ii = 1:(3-1)
	xi = x(ii);
	xnext = x(ii+1);
	new = 100*(xnext-xi^2)^2 + (xi-1)^2;
	sum = sum + new;
end
y = sum;
endfunction
x0=[10,10,10]
intcon=[1,2,3];

[x,fval] =intfminunc(rosenbrock ,x0 ,intcon)