%% Calculate Angle Differences of Adjacent Elements

angles = [pi pi/2 pi/4 pi/2];
d = angdiff(angles)

% Copyright 2019 The MathWorks, Inc.