Main Content

rfplot

Plot S-parameter data

Description

example

rfplot(s_obj) plots the magnitude in dB versus frequency of all S-parameters (S11, S12 ... SNN) on the current axis. s_obj must be an S-parameter object.

rfplot(s_obj,i,j) plots the magnitude of Si, j, in decibels, versus frequency on the current axis.

rfplot(___,LineSpec) plots S-parameters using optional line types, symbols, and colors specified by LineSpec.

rfplot(___,plotflag) allows to specify the type of plot by using the plotflag.

example

hline = rfplot(___) plots the S-parameters and returns the column vector of handles to the line objects, hline.

[hline,haxes] = rfplot(filter,frequencies) plots the magnitude response of the S-parameters for the rf filter.

Examples

collapse all

Use sparameters to create a set S-parameters.

hs = sparameters('default.s2p');

Plot all S-parameters.

rfplot(hs)

Figure contains an axes object. The axes object contains 4 objects of type line. These objects represent dB(S_{11}), dB(S_{21}), dB(S_{12}), dB(S_{22}).

Plot S21.

rfplot(hs,2,1)

Figure contains an axes object. The axes object contains an object of type line. This object represents dB(S_{21}).

Plot the angle of S21 in degrees.

rfplot(hs,2,1,'angle')

Figure contains an axes object. The axes object contains an object of type line. This object represents angle(S_{21}).

Plot the real part of S21.

rfplot(hs,2,1,'real')

Figure contains an axes object. The axes object contains an object of type line. This object represents real(S_{21}).

Input Arguments

collapse all

S-parameters, specified as an RF Toolbox™ network parameter object. To create this type of object, use the sparameters function.

Row index of data to plot, specified as a positive integer.

Column index of data to plot, specified as a positive integer.

Line style, marker, and color, specified as a character vector or string containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color). For example, if you omit the line style and specify the marker, then the plot shows only the marker and no line.

Example: '--or' is a red dashed line with circle markers

Line StyleDescriptionResulting Line
'-'Solid line

Sample of solid line

'--'Dashed line

Sample of dashed line

':'Dotted line

Sample of dotted line

'-.'Dash-dotted line

Sample of dash-dotted line, with alternating dashes and dots

MarkerDescriptionResulting Marker
'o'Circle

Sample of circle marker

'+'Plus sign

Sample of plus sign marker

'*'Asterisk

Sample of asterisk marker

'.'Point

Sample of point marker

'x'Cross

Sample of cross marker

'_'Horizontal line

Sample of horizontal line marker

'|'Vertical line

Sample of vertical line marker

's'Square

Sample of square marker

'd'Diamond

Sample of diamond line marker

'^'Upward-pointing triangle

Sample of upward-pointing triangle marker

'v'Downward-pointing triangle

Sample of downward-pointing triangle marker

'>'Right-pointing triangle

Sample of right-pointing triangle marker

'<'Left-pointing triangle

Sample of left-pointing triangle marker

'p'Pentagram

Sample of pentagram marker

'h'Hexagram

Sample of hexagram marker

Color NameShort NameRGB TripletAppearance
'red''r'[1 0 0]

Sample of the color red

'green''g'[0 1 0]

Sample of the color green

'blue''b'[0 0 1]

Sample of the color blue

'cyan' 'c'[0 1 1]

Sample of the color cyan

'magenta''m'[1 0 1]

Sample of the color magenta

'yellow''y'[1 1 0]

Sample of the color yellow

'black''k'[0 0 0]

Sample of the color black

'white''w'[1 1 1]

Sample of the color white

Plot types, specified as the following values: 'db', 'real', 'imag', 'abs', 'angle'.

Example: 'angle'

RF filter, specified as an rffilter object or a lcladder object.

Frequencies to plot magnitude response, specified as a vector.

Output Arguments

collapse all

Line containing the S-parameter plot, returned as a line handle.

Axes of the rfplot, returned as an axes handle.

See Also

| | | (Antenna Toolbox) | |

Introduced before R2006a