Main Content

patternCustom

Plot radiation pattern using spherical coordinate system (phi and theta angles)

Description

patternCustom(magE,theta,phi) plots the 3-D radiation pattern of an antenna or array with magnitude magE over the specified phi and theta angle vectors. Using patternCustom on multiple datasets plots multiple radiation patterns in the same figure.

example

patternCustom(magE,theta,phi,Name=Value) plots the 3-D radiation pattern of an antenna or array using additional options specified by one or more Name-Value Arguments.

example

hplot = patternCustom(___) returns handles of the lines or surface in the figure window. This syntax accepts any combination of arguments from the previous syntaxes

Examples

collapse all

This example uses a sample .csv file containing helix antenna data. Import the .csv file to the workspace using readmatrix function. This file contains the magnitude of the antenna directivity at phi and theta angles.

helixdata = readmatrix("antennadata_test.csv");

Use patternCustom to plot the magnitude of directivity, phi, and theta angle values as the 3-D radiation pattern.

patternCustom(helixdata(:,3),helixdata(:,2),helixdata(:,1));

Figure contains an axes object. The hidden axes object contains 16 objects of type surface, line, text, patch.

Use the same data to plot the 3-D radiation pattern in the rectangular coordinate system using pattern plot options.

p = PatternPlotOptions(Transparency=0.6);
figure
patternCustom(helixdata(:,3),helixdata(:,2),helixdata(:,1),...
 CoordinateSystem="rectangular", PatternOptions=p);

Figure contains an axes object. The axes object with xlabel Theta (degree), ylabel Phi (degree) contains an object of type surface.

Calculate the directivity magnitude, azimuth, and elevation angles from a helix's radiation pattern at 2 GHz.

h = helix;
[D,az,el] = pattern(h,2e9);

Here, az = the angle from the positive x-axis to the directivity vector's orthogonal projection onto the xy plane, moving in the direction towards the y-axis.

el = the angle from the directivity vector's orthogonal projection onto the xy plane to the vector, moving in the direction towards the z-axis.

Extract theta and phi angles of the directivity magnitude.

phi = az';
theta = (90-el);
MagE = D';

Plot 2-D phi slice of the antenna in rectangular coordinates.

figure
patternCustom(MagE, theta, phi, CoordinateSystem="rectangular",...
    Slice="phi", SliceValue=0);

Figure contains an axes object. The axes object with xlabel Theta (degree), ylabel Magnitude contains an object of type line. This object represents phi =0 deg.

Plot 2-D phi slice of the antenna in polar coordinates.

figure;
patternCustom(MagE, theta, phi, CoordinateSystem="polar",...
    Slice="phi", SliceValue=0);

Figure contains an axes object. The hidden axes object contains an object of type line. This object represents phi=0° .

Input Arguments

collapse all

Magnitude of plotted quantity, specified as one of the following:

  • A N-by-1 real vector. N is the same size as the phi and theta angle vectors.

  • A M-by-R matrix. The matrix should be the same size as phi x theta.

where theta and phi angles are in the spherical coordinate system specified as a vector.

Data quantities plotted include directivity, E-fields, H-fields, or power of an antenna or array.

Data Types: double

Theta angles in spherical coordinates, specified as a vector in degrees. If azimuth and elevation values are given, theta angle values are 90 degrees minus elevation.

For more information, Antenna Toolbox Coordinate System.

Data Types: double

Phi angles in spherical coordinates, specified as a vector in degrees. If azimuth and elevation values are given, phi angle values are same as azimuth values.

For more information, Antenna Toolbox Coordinate System.

Data Types: double

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: CoordinateSystem="rectangular"

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'CoordinateSystem','rectangular'

Coordinate system of radiation pattern, specified as either "polar" or "rectangular".

Example: "rectangular"

Data Types: string

Plane to visualize 2-D data, specified as either "theta" or "phi".

Example: "phi"

Data Types: string

Angle values for slice, specified as either a scalar or a vector.

Example: [45 60]

Data Types: double

Parameter to change pattern plot properties, specified as a PatternPlotOptions object. The properties that you can vary are:

  • Transparency

  • MagnitudeScale

Other properties used in the PatternOptions for the inset figure are ignored in patternCustom.

Example: PatternPlotOptions(Transparency=0.1)

Data Types: double

Output Arguments

collapse all

Lines or surfaces in figure window, returned as object handle.

Version History

Introduced in R2016a