You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

10 lines
262 B

%DIFF2 Two point difference
%
% D = DIFF2(V) is the 2-point difference for each point in the vector v
% and the first element is zero. The vector D has the same length as V.
%
% See also DIFF.
function d = diff2(v)
[r,c] =size(v);
d = [zeros(1,c); diff(v)];