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 (최근 30일)
이전 댓글 표시
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 *
댓글 수: 1
Walter Roberson
2011년 11월 13일
You will need to describe what you want the plot to look like, and what you see instead.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!