%% Apply Phase Shift to Matrix
% Define a two-column matrix P that contains phase angles.

P = [0 7.07; 0.19 0.98; 6.67 1.18; 0.59 1.37; 0.78 1.56]

% The phase angles P(1,2) = 7.07 and P(3,1) = 6.67 have phase differences that are larger than \pi compared to the rest of the data.
% Unwrap the phase angles by first comparing the elements columnwise. Specify the dim argument as 1. Use the default jump threshold \pi by specifying the second argument as [].

dim = 1;
P1 = unwrap(P,[],dim)

% To shift phase angles by rows instead of by columns, specify dim as 2 instead of 1.

dim = 2;
P2 = unwrap(P1,[],dim)

%
% Copyright 2019 The MathWorks, Inc.