I am using an oldish version of MatLab, r2009a, where the manual entry on FSOLVE states that, "when x has complex variables, the variables must be split into real and imaginary parts".
However, FSOLVE seems to handle complex solutions quite well. Here's a simple example:
opt=optimset('Maxiter',200,'TolX',1e-7,'Tolfun',1e-7); fsolve(@(x)1i*x^2-2i*x+5i,0.5i,opt) Optimization terminated: first-order optimality is less than options.TolFun. ans = 1.0000 + 2.0000i
I've also checked the actual problem I'm working with — an eigenvalue problem for a second-order linear differential operator — and FSOLVE works for it perfectly well too (I've solved the problem twice: by applying FSOLVE to the complex problem "as is" and by splitting it into real and imaginary parts).
So, my question is: in which cases FSOLVE canNOT handle complex roots?
Best Answer