[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: passing parameters to fzero, fsolve?

From: DGati
Subject: Re: passing parameters to fzero, fsolve?
Date: Tue, 28 Jun 2011 06:33:39 -0700 (PDT)

Octave's fsolve, fzero and fminunc do not support passing additional 
arguments this way, and I think it is considered deprecated even by 
MathWorks. As of now, I have no intentions to add the support. The 
"modern" way is to construct a function handle: 

fzero (@(x) foo (x, p), [-5, 5], options) 

function handles are more general and powerful tool to accomplish the 
goal, and they require no special code support in each function you 
need. another possibility is to use global shared variables. 
Jaroslav Hajek-2 wrote:

I've just tried using fsolve with the above syntax. In my case this looks

param = [vector of parameters, all defined];
guess = [5; 5];
k = fsolve(@(k) dcap(k, param), guess)

This does return a vector of k, but also an endless flood of warnings with
the following text:
 warning: matrix singular to machine precision, rcond = 0
 warning: attempting to find minimum norm solution
 warning: dgelsd: rank deficient 2x2 matrix, rank = 1

This repeats at least 10 times, probably because of iterations. If I add an
empty options matrix at the end of the syntax for fsolve, then I don't get
this flood, but the Invalid call to optimget error.

Do you have an idea what the cause could be?

View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]