kakar133
Member level 2
- Joined
- Sep 16, 2010
- Messages
- 49
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- USA
- Activity points
- 1,579
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);