Y = peak2peak(X) returns
the difference between the maximum and minimum values in X. peak2peak operates
along the first nonsingleton dimension of X by
default. For example, if X is a row or column
vector, Y is a real-valued scalar. If Y is
an N-by-M matrix with N>1, Y is a 1-by-M row
vector containing the maximum-to-minimum differences of the columns
of X.

Y = peak2peak(X,DIM) computes
the maximum-to-minimum differences of X along
the dimension, DIM.

Input Arguments

X

Real- or complex-valued input vector or matrix. By default, peak2peak acts
along the first nonsingleton dimension of X.
For complex-valued inputs, peak2peak identifies
the maximum and minimum in absolute value. peak2peak subtracts
the complex number with the minimum modulus from the complex number
with the maximum modulus.

DIM

Dimension for maximum-to-minimum difference. The optional DIM input
argument specifies the dimension along which to compute the maximum-to-minimum
differences.

Default: First nonsingleton dimension

Output Arguments

Y

Maximum-to-minimum difference. For vectors, Y is
a real-valued scalar. For matrices, Y contains
the maximum-to-minimum differences computed along the specified dimension, DIM.
By default, DIM is the first nonsingleton dimension.