Quadratic spline having shape preserving property
12 ビュー (過去 30 日間)
古いコメントを表示
Mohammad Shojaei Arani
2022 年 5 月 29 日
回答済み: Mohammad Shojaei Arani
2022 年 5 月 30 日
Hello friends,
In my work I need to use quadratic splines and I can use the command spapi(3,x_data,y_data). Unfortunately, I cannot find a quadratic
spline framework in matlab which also supports 'Shape preserving'. I know that pchip can do the job for cubic splines but to speed up
my codes I cannot use pchip, unfortunately.
I am wondering whether matlab can do what I need? I am
Thanks for your help, in advance!
Babak
0 件のコメント
採用された回答
John D'Errico
2022 年 5 月 29 日
You cannot define a shape preserving quadratic spline that is differentiable across the breaks.
So while you think you want it, you will be unhappy with the result, even if you did manage to formulate such an animal.
Why you cannot use pchip I don't know, because pchip will be extrmely fast. My guess is you are not using pchip efficiently, but I have no clue as to what it is you are doing with the code, so that is difficult to guess. But I will claim that any quadratic spline you do formulate will not provide any significant speedup over pchip, IF used properly. There will be many other places in your code where you would gain far more, even if you could find some insignificant speed gains over pchip.
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Splines についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!