Check out example codes for "phase of a complex number matlab". It will help you in understanding the concepts better.

Code Example 1

a = 1 + 2j 

mag_a = abs(a) %% the magnitude of the complex variable

phase_a = angle(a) %% the phase of the complex variable

Learn ReactJs, React Native from akashmittal.com