summaryrefslogtreecommitdiff
path: root/tests/general_tests/lsqnonneg/lsqnonneg_logical2.sce
blob: ede09e6e39e445ed62c6ef76b34e28a1ff2cfa3d (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
34
35
36
37
38
39
40
41
42
43
44
// An example with C, d and options
C = [1 1 1;
	1 1 0;
	0 1 1;
	1 0 0;
	0 0 1]
d = [89;
	67;
	53;
	35;
	20]
options = list("MaxIter", 300);

//Output
//Optimal Solution Found.
// lambda  =
// 
//   lower: [5.131D-09,5.546D-09,8.739D-09]
//   upper: [0,0,0]
// output  =
// 
//   Iterations: 7
//	 ConstrViolation: 0
// exitflag  =
// 
//  0  
// residual  =
// 
//    0.75   
//  - 0.625  
//  - 0.125  
//  - 0.125  
//  - 0.625  
// resnorm  =
// 
//    1.375  
// xopt  =
// 
//    35.125  
//    32.5    
//    20.625  

[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d,options)