?? diffn.m
字號:
function d=diffn(x,n)
% The function DIFFN provides a variable window differentiation on data.
%
% Calling sequence-
% d=diffn(x,n)
%
% Example-
% d=diffn(lod78_p',501);
%
% Input-
% x - matrix x(r,c) where r is data length and
% c is number of components. Data should be
% in column form, or columns.
% n - the full Window Width, an odd number greater then 1
% Output-
% d - matrix d(r-n+1,c) that contains the difference
% between pairs of values located n-1 points apart:
% Dx/Dt, where Dt=n-1
% Steven R.Long (NASA GSFC/WFF/NASIRF) Initial
[r,c]=size(x); % Get Rows & Columns of Data Input x
% Length of r is data length
% Number of c is number of components
hw=(n-1)/2; % Half-Width of Window
bp=(n+1)/2; % Beginning Point, Center of First Window
d=zeros(r-n+1,c); % Result Data is n-1 less in data length
for j=1:c; % Do Each Component
for i=bp:r-hw; % Reduced Size within c
ii=i-hw; % Corresponding Locations in Reduced Matrix
% Difference Over Window Width
leftpt=ii;
rightpt=i+hw;
d(ii,j)=x(rightpt,j)-x(leftpt,j); % Difference of End.Pts,
% rightpt is later in t
end; % Difference Over Window Placed in Center
end; % Calculated Over All Columns
return;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -