fzero function for complex vector root

조회 수: 7 (최근 30일)
Syed Nazmul Ahsan
Syed Nazmul Ahsan 2014년 2월 24일
댓글: Alan Weiss 2014년 2월 24일
I want to evaluate roots of a nonlinear function which generates vectors of complex number. is that possible using fzero function?

답변 (1개)

Walter Roberson
Walter Roberson 2014년 2월 24일
No, fzero() can only alter a single real-valued number and the fitness function must return a single real-valued result that crosses 0 (fzero is not suitable for functions that only touch zero such as sum(abs(Vectors)) )
If you are working with multiple values (including real and imaginary parts of a single variable) then you should be using a function from the Optimization Toolbox or the Global Optimization Toolbox. The functions that are provided in base MATLAB operate on a single real value and need a single real result.
  댓글 수: 1
Alan Weiss
Alan Weiss 2014년 2월 24일
To expand on Walter's answer, you can use the fsolve function in Optimization Toolbox. All you have to do is ensure that the inputs and outputs are real vectors, instead of complex scalars. Use the real and imag functions to convert to real vectors.
Alan Weiss
MATLAB mathematical toolbox documentation

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

카테고리

Help CenterFile Exchange에서 Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by