Hi Biplob,
I understand you’re trying to plot the phase of the Electric field on the same plane as the magnitude (which is plotted by the ‘EHfields’ function.
After defining the points (line 42), the following steps will achieve the desired result:
- Get the x,y and z component of the Electric field (E-field) and Magnetic field (H-field)
[E,H]=EHfields(arr,2.4e9,p);
- Plot the E-field along the specified plane
- Plot phase of the E-field along the same plane as above (in a new figure):
The ‘fieldsCustom’ function is used to plot the E/H fields at specified points in space in the current axes. Retaining the same points (‘p’) for plotting the E-field and phase would ensure both are plotted along the same plane.
As per the expectation, the output would be as follows:
Please refer to the documentation for more information: