curvefitting of complex number
1 回表示 (過去 30 日間)
古いコメントを表示
I get following error when i use Lsqcurvefit
Warning: Imaginary parts of complex X and/or Y arguments ignored.
> In myfun (line 11).
I want both real and imaginary parts
1 件のコメント
採用された回答
Harshit Gupta
2022 年 11 月 15 日
Hi Supreeth,
As per my understanding, you are getting the following warning:
Warning: Imaginary parts of complex X and/or Y arguments ignored.
And you want both real and imaginary parts to be included in your plot, while using "lsqcurvefit".
Please refer below to resolve your query:
- "lsqcurvefit" can solve complex-valued problems directly. Note that bound constraints do not make sense for complex values. For a complex problem with bound constraints, split the variables into real and imaginary parts. See Fit a Model to Complex-Valued Data.
- If you want to plot the real part of a vector versus the complex part, pass the vector as a single complex vector to the "plot" function.
- If you want to plot the magnitude of the elements, use the “abs” function on the vector before passing it to the “plot” function.
- Please refer to the following link for more information on the “abs” function: https://www.mathworks.com/help/matlab/ref/abs.html
- Please refer to the following link for more information on the “plot” function: https://www.mathworks.com/help/matlab/ref/plot.html
- You can refer to the following MATLAB Answers link for more information about this warning: https://www.mathworks.com/matlabcentral/answers/96197-why-do-i-get-warning-messages-about-imaginary-parts-of-complex-x-and-or-y-arguments-ignored
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!