Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1471
Number of posts: 2147

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Curve fitting problems regarding complex values Posted by cupidsd on 14 Feb 2012 at 8:09 PM
Hi all, I got a question for you. It is about how to curve fitting and what values are the best in my case. The following is part of my codes. I am using lsqcurvefit, which can not deal with complex values.

Thus, I have to convert complex values to real, but the problem is which method is the best. (1) only the real part of complex values is considered and handled, the imaginary part is ignored. (2) instead of using real, we could choose to use absolute values.

Another question is if we give different initial values for these coefficients, we will get different best values for them. But which ones are the best? It depends on what conditions.

x0=[1.3E-03; 0.2; 5.4; 1]
[x,resnorm] = lsqcurvefit(@myfun,x0,xdata,ydata)
function F = myfun(x,xdata)
F =x(1)*(1-exp(-real(power(((xdata-x(2))/x(3)),x(4)))))
end
Report
Re: Curve fitting problems regarding complex values Posted by cupidsd on 14 Feb 2012 at 8:12 PM
Can anyone remove one of my 2 posts? I have no idea what happended to the website and somehow my post was published twice. Thanks a lot.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.