Plotting phase distribution on a desired plane using the data retrieved from the EHfields function.

20 次查看(过去 30 天)
Hi,
I want to plot the phase distribution on a 2D plane for an array. I am able to plot the vector E and H fields on the desired plane using EHfields function. But how do I plot the phase of the E-field on the same plane? The desired plot in my case would look like a spiral distribution.
Attaching the code for your reference:
%% Circular Array parameters
N = 8;
r = 0.075;
l = 2;
%% Feed Locations OR Element Position
for n = 1: N
pos(n,:) = [r*cos(2*pi*(n-1)/N) r*sin(2*pi*(n-1)/N) 0];
end
%% Phase Shift assigned on each element (depends on l)
phs_element = NaN(N,1);
for n = 1 : N
phs_element(n,:) = (2*pi*n*l/N)*(180/pi);
end
%% Defining array
arr = conformalArray;
dip = dipole;
dip.Length = 0.058709;
dip.Width = 0.0012491;
arr.Element = dip;
arr.ElementPosition = pos;
arr.PhaseShift = phs_element;
%% Plotting E and H field vector on a desired plane
x = linspace(-1,1,100);
y = linspace(-1,1,100);
z = zeros(100);
figure
hslice = surf(x,y,z);
xlabel('x-axis');
ylabel('y-axis');
zlabel('z-axis');
colorbar;
rotate(hslice,[1,0,0],30);
xd = get(hslice,'XData');
yd = get(hslice,'YData');
zd = get(hslice,'ZData');
delete(hslice)
p = [xd(:)';yd(:)';zd(:)'];
EHfields(arr,2.4e9,p)
Thank You.
Biplob Biswas.

采纳的回答

Saarthak Gupta
Saarthak Gupta 2023-9-5
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);
  • Get phase of the E-field
thetaE=angle(E);
  • Plot the E-field along the specified plane
fieldsCustom(E,p);
  • Plot phase of the E-field along the same plane as above (in a new figure):
figure;
fieldsCustom(thetaE,p);
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:

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Antenna Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by