How do I use the ppval, pp and spline in this situation?

7 ビュー (過去 30 日間)
Sakina
Sakina 2018 年 4 月 28 日
コメント済み: Ameer Hamza 2018 年 4 月 28 日
I have the following in a code:
pp=spline(diameter,nbdensity);
all(i,j) = ((diameter(i,1)^3)-(diameter(j,1)^3))^(1/3);
finp(i,j) = ppval(pp,all(i,j));
I need to find the interpolated value of "nbdensity" at a given value of "all". How would I express it using the above? Would the following be correct?
nbdensity(i)*finp(i,j)
  5 件のコメント
Sakina
Sakina 2018 年 4 月 28 日
Okay, thank you very much!
Ameer Hamza
Ameer Hamza 2018 年 4 月 28 日
You are welcome.

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

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 4 月 28 日
Given data vectors x and y. f = spline(x, y) function returns a piecewise-polynomial which models the best relation (in the least square sense) f:x->y. After estimating the polynomial, if you want to find the value of y at some arbitrary value of x, you can just evaluate piecewise polynomial f at. In MATLAB you can use ppval function to evaluate the piecewise polynomial f.

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by