?? curvature.m
字號:
function h=ddk(x);
% The function DDK calculates the curvature of data.
%
% Calling sequence-
% h=ddk(x)
%
% Input-
% x - 1-D vector of input data x(n)
% Output-
% h - 2-D matrix of input data h(n,1) that
% specifies the curvature of input data
% Z.Shen (Caltech) Initial
%----- Get dimensions
n=length(x);
%----- Initialize
z=zeros(n,1);
h=zeros(n,1);
%----- Calculate the curvature
for i=2:n-1
z(i)=(x(i+1)-x(i-1))/2.;
h(i)=x(i+1)+x(i-1)-2*x(i);
end
z(1)=x(2)-x(1);
z(n)=x(n)-x(n-1);
h(1)=z(2)-z(1);
h(n)=z(n)-z(n-1);
for i=1:n
a1=(1+z(i)*z(i))*sqrt(1+z(i)*z(i));
h(i)=-1*h(i)/a1;
end
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -