How to obtain complex solutions?

조회 수: 2 (최근 30일)
Viraj Nistane
Viraj Nistane 2014년 6월 5일
답변: Star Strider 2014년 6월 5일
I have some recorded data. I have plotted a curve of this data and I want to fit this data in the curve of the equation: T(p) = f^2 cos2(p) + f.h sin(2p) + h^2 sin2(p) + g^2 cos2(p) + g.k sin(2p) + k^2 sin2(p)
Here, the data is between T and p.
f, g, h and k are constants to be evaluated. The values of these constants are complex numbers. But I am getting only real values. Could somebody please help?
  댓글 수: 1
Roger Wohlwend
Roger Wohlwend 2014년 6월 5일
Well, what can we do to help? Perhaps the solution is real and your expectation is wrong. Are you sure the constants shoud be complex?

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

답변 (1개)

Star Strider
Star Strider 2014년 6월 5일
To the best of my knowledge, the solvers will only estimate real values. If you want to fit complex values, you have to be slightly deceptive.
In this situation, your complex parameters each become two parameters, a real an imaginary part. The fitting function ( nlinfit, lsqcurvefit ) sees, for instance f(1), f(2), while you would refer to them in your function as f = complex(f(1) f(2)), a single parameter.

카테고리

Help CenterFile Exchange에서 Verification, Validation, and Test에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by