kakar133
Member level 2
Hello,every one
I am trying to plot radiation intensity of antenna using the following code but it is giving me an error. please, help me
PI = 4.0*atan(1.0);
E = 120.0*PI;
L=1;
Io = 1;
r=2;
k=2*pi;
THETA=0:1:359;
polar(THETA,(((cos(k/2*L*cos(THETA*pi/180))-cos(k/2*L))/sin(THETA*pi/180))^2*(E*Io^2/(8.0*PI^2))),'--r');
and the error is given below
Error using polar (line 61)
THETA and RHO must be the same size.
Error in Q1 (line 19)
polar(THETA,(((cos(k/2*L*cos(THETA*pi/180))-cos(k/2*L))/sin(THETA*pi/180))^2*(E*Io^2/(8.0*PI^2))),'--r');
- - - Updated - - -
i resolved the problem but i am not getting polar plots in degree co-orditanates. can any body please help me . I have attached the graph and here is my code.
PI = 4.0*atan(1.0);
E = 120.0*PI;
L=1/4;
A = L*PI;
Io = 1;
r=2;
k=2*pi;
THETA=0:0.01:2*pi;
U =((cos(k/2*L.*cos(THETA))-cos(k/2*L))./sin(THETA)).^2*(E./(8.0*PI^2));
polar(THETA,U);