plot a fitted curve and specified axes
3 ビュー (過去 30 日間)
古いコメントを表示
Heyhey,
I have a problem with the follwing lines
fit_func = fittype("poly1");
fitdata = fit(XValues,YValues,fit_func);
h=plot(ax,fitdata);
-> so I got the error
Error using plot
Data must be numeric, datetime, duration or an array convertible to double.
If I use this line instead:
h=plot(fitdata);
Everything is fine
So my question: how am I able to use plot to creates the line in the axes specified by ax?
3 件のコメント
Geoff Hayes
2022 年 1 月 29 日
@Alexander Richter - are you using the same code or something different? Please provide details.
回答 (1 件)
Geoff Hayes
2020 年 5 月 14 日
plot(fitdata, 'Parent', hAxes)
where hAxes is the handle to your axes.
4 件のコメント
Marleen
2022 年 2 月 9 日
Why is it possible to specify the parent axes (a Name Value pair) for sfit objects but not for cfit?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/888705/image.png)
参考
カテゴリ
Help Center および File Exchange で Fit Postprocessing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!