%% Calculate Angle Differences of Adjacent Elements

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

% Copyright 2015 The MathWorks, Inc.