?? natcub.m
字號:
% NATCUB : Determination of values for the first derivatives [f]%% [B] = NATCUB (X,Y) %% Returns in B the estimates for the first derivatives for a% spline fit through the points given in X and Y with a continuous% second derivative.function [b]=natcub(x,y)n= length(x);if n <3, error('Number of points < 3.'); returnendgamma(1)=0.5;for i = 2:n-1 gamma(i) = 1/(4-gamma(i-1));endgamma(n) = 1/(2-gamma(n-1));delta(1)=3*(y(2)-y(1))*gamma(1);for i = 2:n-1 delta(i) = (3*(y(i+1)-y(i-1))-delta(i-1))*gamma(i);enddelta(n) = (3*(y(n)-y(n-1))-delta(n-1))*gamma(n);b(n)=delta(n);for i = n-1:-1:1 b(i) = delta(i)-gamma(i)*b(i+1);end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -