How to create function handle from fit struct after using curve fitting toolbox?
5 ビュー (過去 30 日間)
古いコメントを表示
I have this struct as result of my curve fitting toolbox, now I need to create a function handle based on my spline coefficients. Can any one help?
0 件のコメント
回答 (4 件)
Stephan
2018 年 7 月 13 日
Hi,
Why do you need this? You can directly compute new values for your fitresult:
y_new = fitresult(x_new)
This returns the vector corresponding to x_new, which should exactly be the result you expect from a function handle.
Best regards
Stephan
1 件のコメント
Stephan
2018 年 7 月 13 日
編集済み: Stephan
2018 年 7 月 13 日
Iam not in the near of my computer to test it, but i think this should work:
f = @(x)fitresult(x)
ga should accept this function handle i think.
You can test:
y_expected = f(x_known)
If this returns the correct value for y you are fine.
Best regards
Stephan
参考
カテゴリ
Help Center および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!