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
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