summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/lsqnonneg.dem.sce20
-rw-r--r--demos/symphonymat.dem.sce7
2 files changed, 23 insertions, 4 deletions
diff --git a/demos/lsqnonneg.dem.sce b/demos/lsqnonneg.dem.sce
new file mode 100644
index 0000000..f9d5d78
--- /dev/null
+++ b/demos/lsqnonneg.dem.sce
@@ -0,0 +1,20 @@
+mode(1)
+//
+// Demo of lsqnonneg.sci
+//
+
+A basic lsqnonneg problem
+C = [
+0.0372 0.2869
+0.6861 0.7071
+0.6233 0.6245
+0.6344 0.6170];
+d = [
+0.8587
+0.1781
+0.0747
+0.8405];
+[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d)
+halt() // Press return to continue
+
+//========= E N D === O F === D E M O =========//
diff --git a/demos/symphonymat.dem.sce b/demos/symphonymat.dem.sce
index f069d38..553cd99 100644
--- a/demos/symphonymat.dem.sce
+++ b/demos/symphonymat.dem.sce
@@ -4,7 +4,7 @@ mode(1)
//
// Objective function
-c = [350*5,330*3,310*4,280*6,500,450,400,100]'
+c = [350*5,330*3,310*4,280*6,500,450,400,100]';
// Lower Bound of variable
lb = repmat(0,1,8);
// Upper Bound of variables
@@ -36,8 +36,7 @@ objCoef = -1*[ 504 803 667 1103 834 585 811 856 690 832 846 813 868 793 ..
959 668 507 855 986 831 821 825 868 852 832 828 799 686 ..
510 671 575 740 510 675 996 636 826 1022 1140 654 909 799 ..
1162 653 814 625 599 476 767 954 906 904 649 873 565 853 1008 632]';
-//Constraint Matrix
-
+//Constraint Matrix
conMatrix = [ //Constraint 1
42 41 523 215 819 551 69 193 582 375 367 478 162 898 ..
550 553 298 577 493 183 260 224 852 394 958 282 402 604 ..
@@ -79,7 +78,7 @@ conMatrix = [ //Constraint 1
483 336 765 637 981 980 202 35 594 689 602 76 767 693 ..
893 160 785 311 417 748 375 362 617 553 474 915 457 261 350 635 ;
];
-nbVar = size(objCoef,1)
+nbVar = size(objCoef,2)
conUB=[11927 13727 11551 13056 13460 ];
// Lower Bound of variables
lb = repmat(0,1,nbVar)