Fzero returns non-zero value

Hello
I have a problem with the function fzero. The function returns a value of lambdastar where my function dphidlambda (see below) is far from zero (on the order of -100 to -200).
lambdastar=fzero(@(lambda) dphidlambda(lambda,q0,langd,Amax,Mmax,rho,lower_asym,alfa,nelem),[1e-9 1e9])
Does anyone know how to solve this problem? The strange thing is that fzero doesn't return any error message that it can't find any zero-point of the function dphidlambda.
\Jonas

댓글 수: 2

Walter Roberson
Walter Roberson 2011년 3월 1일
I think you missed including the code for your function ?
Matt Tearle
Matt Tearle 2011년 3월 1일
And the output from fzero

댓글을 달려면 로그인하십시오.

답변 (2개)

Matt Fig
Matt Fig 2011년 3월 1일

0 개 추천

Include all the details, meaning: the function DPHIDLAMBDA, and the parameters used to call FZERO (q0,langd, Amax, etc).
If you include enough so that we can duplicate your results, then perhaps we could assist you in figuring out what went wrong.
the cyclist
the cyclist 2011년 3월 1일

0 개 추천

Others are correct that more detail would help a lot in diagnosing, but I'll take a wild stab and suggest that you need to set something with tolerances. I suggest:
>> doc optimset

카테고리

도움말 센터File Exchange에서 Arduino Hardware에 대해 자세히 알아보기

태그

질문:

2011년 3월 1일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by