diff options
Diffstat (limited to 'tests/general_tests/intfminunc/rosenbrock.sce')
-rw-r--r-- | tests/general_tests/intfminunc/rosenbrock.sce | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/general_tests/intfminunc/rosenbrock.sce b/tests/general_tests/intfminunc/rosenbrock.sce new file mode 100644 index 0000000..a2569a7 --- /dev/null +++ b/tests/general_tests/intfminunc/rosenbrock.sce @@ -0,0 +1,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) |