📄 testspline.m
字号:
%% Cubic Spline Interpolation%clear;n = 4;x = [ 0.1; 0.2; 0.3; 0.4];f = [ -0.6205; -0.2839; 0.0066; 0.2484];z = [ 0.25 ];fpa = 4;fpb = 2;% Compute free cubic spline[a, b, c, d, iflag] = cfspline( x, f );table(1:n-1,1) = a(1:n-1)';table(1:n-1,2) = b(1:n-1)';table(1:n-1,3) = c(1:n-1)';table(1:n-1,4) = d(1:n-1)';disp(' coefficients of free cubic spline ')disp( ' a(i) b(i) c(i) d(i) ' )disp(table)s = csplineeval( x, a, b, c, d, z )% Compute clamped cubic spline[a, b, c, d, iflag] = ccspline( x, f, fpa, fpb );table(1:n-1,1) = a(1:n-1)';table(1:n-1,2) = b(1:n-1)';table(1:n-1,3) = c(1:n-1)';table(1:n-1,4) = d(1:n-1)';disp(' coefficients of clamped cubic spline ')disp( ' a(i) b(i) c(i) d(i) ' )disp(table)s = csplineeval( x, a, b, c, d, z )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -