フィルターのクリア

Newbie question on feval

3 ビュー (過去 30 日間)
Jeremy
Jeremy 2014 年 7 月 1 日
コメント済み: Jeremy 2014 年 7 月 1 日
I loaded two vectors into my workspace, plotted them versus one another, used the "basic fitting" tool on the plot, and saved the fit to my workspace. So I now have a structure named "ResourceFit" that shows up in my variable list. However, when I try to call
feval('ResourceFit', 0.17)
for example, I get
Error using feval Undefined function 'ResourceFit' for input arguments of type 'double'.
I'm an infrequent Matlab user, but I swear I've done this before....not sure where I'm going wrong.

採用された回答

Matt J
Matt J 2014 年 7 月 1 日
編集済み: Matt J 2014 年 7 月 1 日
I assume you are talking about the feval method for fittype objects, described here
If you have the Curve Fitting Toolbox installed and the object created by the steps you describe is of type "fittype", then it should work if you omit the quotes,
feval(ResourceFit, 0.17)
  4 件のコメント
Jeremy
Jeremy 2014 年 7 月 1 日
Unfortunately no, they're splines. The plots are of cumulative density functions for empirical data, so they're very "non-smooth"....
Jeremy
Jeremy 2014 年 7 月 1 日
Your answer did lead me to a solution though!
It's painful, and I'm not sure why Matlab makes you go through this, but you can:
pp=mkpp(ResourceFit.coeff.breaks, ResourceFit.coeff.coefs)
ppval (pp, 0.17)
and get the correct answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by