blob: 0681d30f187a2148cf35b731ac6c2977dd46dcc0 (
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 = -sqrt(x*x);
endfunction
x1 = [-10];
x2 = [-5];
//Output
//
//Optimal Solution Found.
// lambda =
//
// lower: 1.0000018
// upper: 0.0000018
// output =
//
// Iterations: 5
// Cpu_Time: 0.036
// Objective_Evaluation: 6
// Dual_Infeasibility: 2.390D-11
// Message: "Optimal Solution Found"
// exitflag =
//
// 0
// fopt =
//
// - 9.9999909
// xopt =
//
// - 9.9999909
[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
|