Clear Filters
Clear Filters

this is my coding for beamplot. i have problem with polar plots. it is not working well. can anyone help me with this one. thanks in advance.

1 view (last 30 days)
close all;clear all;
freq=400e6;%input('frequency (e.g 900e6 for 900MHz):');
lambda=3e8/freq
d_ratio=2;%input('ratio of lambda/d:');
d=1/2;%lambda/d_ratio;
M=7;%input('M, number of elements:');
phi_s=50;%input('angle of interest(-90 to 90):');
u_s=(d/lambda)*sin(phi_s*pi/180);
x=5; %step up for plotting graph
SS=zeros(M,1);
ZZ=zeros(1,M);
YY=zeros(1,(180/x));
s=exp(-i*2*pi*u_s*(0:(M-1)))/sqrt(M);
s=s';
c_mf=s';
J=0;
for angle=-180:x:180
J=J+1;
W=zeros(1,M);
u_s=(d/lambda)*sin(angle*pi/180);
SS=zeros(M,1);
for I=1:M
SS(I,1)=exp(-i*2*pi*u_s*(I-1))/sqrt(M);
end
YY(:,J)=c_mf*SS;
end
YY=abs(YY);
YY=YY/max(YY);
J=0;
angle=-180:x:180;
figure(1),close all
plot(angle,YY,'m'), axis([-90 90 0 1]),hold on;
figure(2);
polar(angle,YY,'m');*%this doesn't work well, the polar graph is wrong *

Answers (0)

Categories

Find more on Polar Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!