# patternCustom

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

## Description

example

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.

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.

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));

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);

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);

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

figure;
patternCustom(MagE, theta, phi, CoordinateSystem="polar",...
Slice="phi", SliceValue=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.

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.

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