Matlab model for Power factor measurement

This is a model that I created using Matlab software. It is a true power factor calculator where it uses real power measurement and distortion factor equations. It is suitable for nonlinear circuits, i.e., power electronics circuits.

Oops..I tried to attach it here, but it was blocked and not permitted. So I will give the link when available.

https://www.mathworks.com/matlabcentral/fileexchange/86638-true-power-factor-calculation-block?s_tid=prof_contriblnk