Y
= diff(X
)
calculates differences between adjacent elements of X
along the first array dimension whose size does not equal 1- If
X
is a vector of lengthm
, thenY = diff(X)
returns a vector of lengthm-1
. The elements ofY
are the differences between adjacent elements ofX
. - If
X
is a nonempty, nonvector p-by-m matrix, thenY = diff(X)
returns a matrix of size (p-1)-by-m, whose elements are the differences between the rows ofX
. - If
X
is a 0-by-0 empty matrix, thenY = diff(X)
returns a 0-by-0 empty matrix.
Y
= diff(X
,n
)
calculates the nth difference by applying the diff(X)
operator recursively n
times. In practice, this means diff(X,2)
is the same asdiff(diff(X))
.Y
= diff(X
,n
,dim
)
is the nth difference calculated along the dimension specified by dim
. The dim
input is a positive integer scalar.
No comments:
Post a Comment