division of cfit objects

1 回表示 (過去 30 日間)
Hsinho Huang
Hsinho Huang 2019 年 6 月 16 日
回答済み: Hsinho Huang 2019 年 6 月 16 日
Hi,
I am writing to ask how to do division of two cfit type objects.
From data (x1,y1) and (x2,y2), I obtained two fit curves f1 and f2. Then, I calculated the first derivative D of the curve f2 at each data points of x2. Finally, I wanted to calcuate the P by using D./f1. However, I got this error message : Undefined function 'rdivide' for input arguments of type 'cfit'.
Could you please let me know how I could code the calculation of P correctly?
f1=fit(x1,y1,'smoothingspline','Normalize','on')
f2=fit(x2,y2,'smoothingspline','Normalize','on')
D=differentiate(f2,x2)
P=D./f1

採用された回答

Walter Roberson
Walter Roberson 2019 年 6 月 16 日
P = D./f1(x2);

その他の回答 (1 件)

Hsinho Huang
Hsinho Huang 2019 年 6 月 16 日
Thanks! I could obtain the P values.

カテゴリ

Help Center および File ExchangeFit Postprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by