do_csplines.m
来自「辛普森方法」· M 代码 · 共 12 行
M
12 行
%do_csplines.mKC = 1; dy0 = 2; dyN = 2; % with specified 1st derivatives on boundaryx = [0 1 2 3]; y = [0 1 4 5];xi = x(1)+[0:200]*(x(end)-x(1))/200; %intermediate points[yi,S] = cspline(x,y,xi,KC,dy0,dyN); % %cubic spline interpolationclf, plot(x,y,'ko',xi,yi,'k:')yi = spline(x,[dy0 y dyN],xi); %for comparison with MATLAB built-in ftnhold on, pause, plot(x,y,'ro',xi,yi,'r:')yi = spline(x,y,xi); %for comparison with MATLAB built-in ftnpause, plot(x,y,'bo',xi,yi,'b')KC = 3; [yi,S] = cspline(x,y,xi,KC);% with the 2nd derivatives extrapolatedpause, plot(x,y,'ko',xi,yi,'k')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?