# 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 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) uses additional options specified by one or more Name,Value pair 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

Consider a helix antenna data file in .csv format. This file contains the magnitude of the antenna directivity in phi and theta angles. Read the file .

Use patternCustom to extract the magnitude of directivity, and the phi, and theta angle values. Plot the 3-D polar radiation pattern.

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

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

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

Calculate the magnitude, azimuth, and elevation angles of a helix's directivity 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 object.

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.

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 the comma-separated pair consisting of 'CoordinateSystem' and one of these values: 'polar', 'rectangular'.

Example: 'CoordinateSystem','polar'

Data Types: char

Plane to visualize 2-D data, specified as a comma-separated pair consisting of 'Slice' and 'theta' or 'phi'.

Example: 'Slice','phi'

Data Types: char

Angle values for slice, specified as a comma-separated pair consisting of 'SliceValue' and a scalar or a vector.

Parameter to change pattern plot properties, specified as the comma-separated pair consisting of 'PatternOptions' and a PatternPlotOptions output. The properties that you can vary are:

• Transparency

• MagnitudeScale

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

Example: p = PatternPlotOptions('Transparency',0.1); Create a pattern plot option with a transparency of 0.1. helixdata = csvread('antennadata_test.csv',1,0);patternCustom(helixdata(:,3),helixdata(:,2),helixdata(:,1),'CoordinateSystem','rectangular','PatternOptions',p); Use this pattern plot option to visualize the pattern of a helix antenna.

Data Types: double

## Output Arguments

collapse all

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

## Version History

Introduced in R2016a