[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Passing global variables into sqp
From: |
Alebron |
Subject: |
Passing global variables into sqp |
Date: |
Tue, 28 Dec 2010 02:01:05 -0800 (PST) |
Is it possible to pass global variables into the cost function (phi) in sqp?
This code doesn't work:
global a;
a = 3;
global b;
b = 4;
function r = phi(x)
a
b
x
r=(x(1)-a)^2+(x(2)-b)^2
endfunction
x0=[0;0];
sqp(x0, @phi, [], [])
I get: "error: `a' undefined near line 7 column 3"
Any ideas?
Thanks,
Agustin
--
View this message in context:
http://octave.1599824.n4.nabble.com/Passing-global-variables-into-sqp-tp3165835p3165835.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Passing global variables into sqp,
Alebron <=