patternCustom
Plot radiation pattern using spherical coordinate system (phi and theta angles)
Syntax
Description
patternCustom(
uses
additional options specified by one or more magE
,theta
,phi
,Name,Value
)Name,Value
pair
arguments.
returns
handles of the lines or surface in the figure window. This syntax
accepts any combination of arguments from the previous syntaxeshplot
= patternCustom(___)
Examples
Visualize Radiation Pattern From Antenna Data File
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 .
helixdata = csvread('antennadata_test.csv',1,0);
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);
Visualize 2-D Radiation Patterns of Helix Directivity
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
magE
— Magnitude of plotted quantity
real vector | matrix
Magnitude of plotted quantity, specified as one of the following:
A N-by-1 real vector . N is the same size as the
phi
andtheta
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
— Theta angles in spherical coordinates
vector in degrees
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
— Phi angles in spherical coordinates
vector in degrees
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.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'CoordinateSystem'
,'rectangular'
CoordinateSystem
— Coordinate system of radiation pattern
'polar'
(default) | '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
Slice
— Plane to visualize 2-D data
'theta'
| 'phi'
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
SliceValue
— Angle values for slice
scalar | vector
Angle values for slice, specified as a comma-separated pair
consisting of 'SliceValue'
and a scalar or a vector.
PatternOptions
— Parameter to change pattern plot properties
PatternPlotOptions
object (default) | scalar
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
hplot
— Lines or surfaces in figure window
object handle
Lines or surfaces in figure window, returned as object handle.
Version History
Introduced in R2016a
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)