Shape-preserving rational spline Hermite interpolation
版本 1.0.0 (2.0 KB) 作者:
Sunham Kim
MATLAB codes for Cai and Judd (2012)'s Shape-preserving rational spline Hermite interpolation
rationalspline.m
A quick MATLAB snippet to implement shape-preserving rational spline Hermite interpolation.(Cai and Judd, Economic Letters 2012)
Requires MATLAB 2015a or later. (dependency: discretize
)
Example
x = linspace(0.1,3,30).'; z = linspace(0.1,3,300).';
v = log(x);
s = 1./x;
[f,df,d2f] = rationalspline(x,z,v,s);
truf = log(z);
trudf = 1./z;
figure;
tt = tiledlayout(1,2);
nexttile
hold on;
plot(z,f);
plot(z,truf);
legend('Approximated Level','True Level','Location','best');
hold off;
nexttile
hold on;
plot(z,df);
plot(z,trudf);
legend('Approximated Slope','True Slope','Location','best');
hold off;

引用格式
Sunham Kim (2025). Shape-preserving rational spline Hermite interpolation (https://github.com/sunhamkim/rationalspline/releases/tag/v1.0.0), GitHub. 检索时间: .
MATLAB 版本兼容性
创建方式
R2023a
与 R2015a 及更高版本兼容
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0 |
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库。
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库。