Monday, November 15, 2010

MATLAB-5(POLAR PLOTS )

yesterday i had studied radiation patterns of antennas and bhargav ! one of my friends just wants me to plot the radiation patterns in matlab...........and i can finally plot the radiation patterns.
to plot cos(pi/2 cos(theta).........i had written the following code:

theta=0:pi/40:2*pi
en=cos(pi/2.*cos(theta));
polar(theta,abs(en));

and i got the output as shown bellow:
in the above code plot function will not give correct result as it can plot linear graphs only.and here i got this plot only because of the function 'polar'.but the disadvantage is it cant plot negetive values.so to eliminate that one we should use the function 'abs'.
obseve the following code once:

theta=0:pi/40:2*pi;
en=cos(pi.*cos(theta));
polar(theta,abs(en));

this code is for cos(pi cos(theta))
and the output that i got is as shown above:

theta=0:pi/40:2*pi
en=cos(pi/2.*cos(theta)).*cos(pi.*cos(theta));
polar(theta,abs(en));

the output of the above code is as shown bellow:



thats it!

No comments:

Post a Comment