parameter passing to 'Isqnonlin' in matlab

B

Bilal

Hi,

I want to use 'lsqnonlin' to solve a system of non-linear equations. The function 'fbnd' which contains the set of equations will be called from inside a loop. these equations have unknowns as well as some variables, e.g. n,metc.. So while calling this function I want to provide a value for the variable as parameter with each iteration. In the below code, the function 'fbnd' is called with some initial values 'x0' and constraint 'lb'. Now I wonder, how can can I pass the parameter 'n' from the caller.
As far as I know, 'lsqnonlin' takes a handle function, initial values, upper and low bound.

lb = [0,0];
rng('default')
x0 = 100*randn(2,1);
for a = 1:10
n=a;
x = lsqnonlin(@fbnd,x0,lb) ;
end

Please help me how can I pass a parameter? Any help would be highly appreciated.
thanks
 
R

red floyd

Bilal said:
[OT non C++ code redacted]
This does not look like C++. You would probably get better help when you
posted in a group actually dedicated to your programming language, whatever
it is.

Looks like MATLAB to me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top