0% found this document useful (0 votes)
168 views

Matlab Code

The document provides MATLAB code for plotting radial patterns and performing 3D integration of patterns. The code for plotting radial patterns takes an input array, ensures all values are positive by taking the absolute value and shifting negatives to the positive range, and uses the polar function to plot the pattern. The code for 3D integration calculates the directivity of a dipole oriented along the z-axis by numerically integrating the normalized radiation pattern over the solid angle using the dblquad function. It defines an anonymous function calc for the integrand that returns the sine of the theta value.

Uploaded by

Waddah Abdo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
168 views

Matlab Code

The document provides MATLAB code for plotting radial patterns and performing 3D integration of patterns. The code for plotting radial patterns takes an input array, ensures all values are positive by taking the absolute value and shifting negatives to the positive range, and uses the polar function to plot the pattern. The code for 3D integration calculates the directivity of a dipole oriented along the z-axis by numerically integrating the normalized radiation pattern over the solid angle using the dblquad function. It defines an anonymous function calc for the integrand that returns the sine of the theta value.

Uploaded by

Waddah Abdo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

MATLAB code for plotting radial patterns % Note: The Matlab function (polar) doesnt accept negative values

for ; so instead of plotting from -xx d to !" #e can plot from ! to $xx d as follo#s: d limit % &!; % 'et the range (for example ! to &! d ) ( % abs(())max(abs(()); (*d % &!+log,!(() $ d limit; for (i % ,:length((*d )) if ((*d (i) 0 !) (*d (i) % !; end end polar (theta" (*d ) % Ma-e sure that the argument for the % function polar ((*d ) is al#a.s /%!

MATLAB code for 3-D integration of patterns %1ssume #e need to calculate the 2irectivit. of a short dipole oriented along the 3-axis (( % sin()); %then #e #ill need to integrate the normali4ed 5-2 pattern over %theta and phi %2 % 6p)1; #here the beam solid angle 1 %

| En | 2 sin()dd

%7e can calculate the integration numericall. using dbl8uad: eam'olid1ngle%dbl8uad(9calc:"!"pi"!"&+pi); 2 % 6+pi)( eam'olid1ngle); 2db % ,!+log,!(2); %7here calc: is a function defines the integrand of dbl8uad: function : % calc:(theta"phi) ( % sin(theta); % Note that this should be normali4ed; other#ise .ou % #ill get #rong number for the 2irectivit. :% sin(theta);+abs(();<&;

You might also like