%% Calculate THD percent
% Calculate the THD from harmonic orders [1;5;7;11;13] and harmonic magnitudes [1.1756e+03;0.0437e+03;0.0221e+03;0.0173e+03;0.0127e+03].

harmonicOrder = [1;5;7;11;13];
harmonicMagnitude = [1.1756e+03;0.0437e+03;0.0221e+03;0.0173e+03;...
    0.0127e+03];
thdPercent = ee_calculateThdPercent( harmonicOrder, harmonicMagnitude )

%
% Copyright 2018 The MathWorks, Inc.