blob: 0613aa8dd0dc8a0911e65ab6c1ec874de99e5914 (
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
|
function y = fun(x)
y = log(x);
endfunction
x1 = [-10];
x2 = [0];
//Output
//
//Optimal Solution Found.
// lambda =
//
// lower: 0.0000018
// upper: 0.0000018
// output =
//
// Iterations: 4
// Cpu_Time: 0.028
// Objective_Evaluation: 5
// Dual_Infeasibility: 0
// Message: "Optimal Solution Found"
// exitflag =
//
// 0
// fopt =
//
// 0.
// xopt =
//
// - 0.7727429
[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
|