%% Peak-to-Peak Value of Matrix Input
% Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent  step syntax. For example, myObject(x) becomes step(myObject,x).
% Determine the peak-to-peak value of a matrix input.

in = magic(4);
ptp = dsp.PeakToPeak;
ptp.Dimension = 'All';
y = ptp(in)

% Copyright 2012 The MathWorks, Inc.