blob: 8207f9277a17d7b9d04ca242829004596d0218db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
function y = fun(x)
y = exp(x);
endfunction
x1 = [-1000];
x2 = [1000];
//Output
//
//Optimal Solution Found.
// lambda =
//
// lower: 9.183D-09
// upper: 9.001D-09
// output =
//
// Iterations: 10
// Cpu_Time: 0.064
// Objective_Evaluation: 11
// Dual_Infeasibility: 0.0000455
// Message: "Optimal Solution Found"
// exitflag =
//
// 0
// fopt =
//
// 0.0000455
// xopt =
//
// - 9.9979363
[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
|