Plot S-parameter data
collapse all in page
Syntax
rfplot(s_obj)
rfplot(s_obj,i,j)
rfplot(s_obj,[i1:in],[j1:jn])
rfplot(s_obj,{[i1 j1];...;[in jn]})
rfplot(___,LineSpec)
rfplot(___,plotflag)
rfplot(s_obj,'diag')
rfplot(s_obj,part)
rfplot(s_obj,part,k)
rfplot(ax,___)
hline = rfplot(___)
[hline,haxes] = rfplot(filter,frequencies)
Description
rfplot(s_obj)
plots the magnitude in decibels versus frequency of all S-parameters (S11, S12 ... SNN) on the current axes.
example
rfplot(s_obj,i,j)
plots the magnitude of Si j in decibels on the current axis.
rfplot(s_obj,[i1:in],[j1:jn])
plots the magnitude of multiple S-parameters in decibels on the current axis.
example
rfplot(s_obj,{[i1 j1];...;[in jn]})
plots the magnitude of specific S-parameters in decibels on the current axis.
example
rfplot(___,LineSpec)
plots S-parameters using the line parameters specified in LineSpec
.
rfplot(___,plotflag)
plots S-parameters according to the type specified in plotflag
.
rfplot(s_obj,'diag')
plots the magnitude of Si i reflection coefficients or the diagonal elements of the S-parameter matrix 'diag'
on the current axis.
example
rfplot(s_obj,part)
plots the upper or lower triangular portion of the S-parameters matrix on the current axis.
rfplot(s_obj,part,k)
plots the elements on, above, or below the k
th diagonal of the S-parameters matrix. For more information, see the tril and triu functions.
example
rfplot(ax,___)
plots the S-parameters on the axes specified in ax
instead of the current axes. Specify ax
as the first input argument followed by any of the input argument combinations in the previous syntaxes. Return the current axes using the gca function.
hline = rfplot(___)
plots the S-parameters and returns a column vector of line handles in hline
.
example
[hline,haxes] = rfplot(filter,frequencies)
plots the magnitude response of the S-parameters of the RF filter.
Examples
collapse all
Plot S-Parameter Data
Use the sparameters
function to create a set S-parameters.
hs = sparameters('default.s2p');
Plot all the S-parameters.
rfplot(hs)
Plot S21.
rfplot(hs,2,1)
Plot the angle of S21 in degrees.
rfplot(hs,2,1,'angle')
Plot the real part of S21.
rfplot(hs,2,1,'real')
Plot S-Parameters in Specified Range
Open Live Script
Create an S-parameter object from a three-port Touchstone file.
sobj = sparameters('default.s3p');
Plot S12, S13, S22, S23, S32, and S33.
rfplot(sobj,[1:3],[2:3],'abs')
Plot Specific S-Parameters
Open Live Script
Create an S-parameter object from a three-port Touchstone file.
sobj = sparameters('default.s3p');
Plot S12, S33, S11, and S22.
rfplot(sobj,{[1 2]; [3 3]; [1 1]; [2 2]},'abs')
Plot Reflection and Transmission Coefficients
Open Live Script
Create an S-parameter object from a three-port Touchstone file.
sobj = sparameters('default.s3p');
Plot the reflection coefficients of the S-parameters.
rfplot(sobj,'diag','abs')
Plot the transmission coefficients of the S-parameters.
rfplot(sobj,'triu',1,'abs')hold onrfplot(sobj,'tril',-1,'abs')
Input Arguments
collapse all
s_obj
— S-parameters
network parameter object
S-parameters, specified as RF Toolbox™ network parameter object. To create this type of object, use the sparameters
function.
i
— Row index
scalar | vector | cell array
Row index of the data to plot, specified as a scalar, vector, or cell array.
Type of Plot | How to Specify Indices |
---|---|
Single parameter | Specify
|
Set of parameters | Specify
|
Specific parameters | Specify a cell array of
|
j
— Column index
scalar | vector | cell array
Column index of the data to plot, specified as a scalar, vector, or cell array.
Type of Plot | How to Specify Indices |
---|---|
Single parameter | Specify i and
|
Set of parameters | Specify
|
Specific parameters | Specify a cell array of
|
LineSpec
— Line style, marker, and color
character vector | string
Line style, marker, and color, specified as a character vector or a 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'
creates a dashed line in red with circular markers
Line Style | Description | Resulting Line |
---|---|---|
'-' | Solid line | |
'--' | Dashed line | |
':' | Dotted line | |
'-.' | Dash-dotted line |
Marker | Description | Resulting Marker |
---|---|---|
'o' | Circle | |
'+' | Plus sign | |
'*' | Asterisk | |
'.' | Point | |
'x' | Cross | |
'_' | Horizontal line | |
'|' | Vertical line | |
's' | Square | |
'd' | Diamond | |
'^' | Upward-pointing triangle | |
'v' | Downward-pointing triangle | |
'>' | Right-pointing triangle | |
'<' | Left-pointing triangle | |
'p' | Pentagram | |
'h' | Hexagram |
Color Name | Short Name | RGB Triplet | Appearance |
---|---|---|---|
'red' | 'r' | [1 0 0] | |
'green' | 'g' | [0 1 0] | |
'blue' | 'b' | [0 0 1] | |
'cyan' | 'c' | [0 1 1] | |
'magenta' | 'm' | [1 0 1] | |
'yellow' | 'y' | [1 1 0] | |
'black' | 'k' | [0 0 0] | |
'white' | 'w' | [1 1 1] | |
plotflag
— Plot types
'db'
(default) | 'real'
| 'imag'
| 'abs'
| 'angle'
Plot types, specified as either 'db'
, 'real'
, 'imag'
, 'abs'
, or 'angle'
.
Example: 'angle'
filter
— RF filter
rffilter
object | lcladder
object
RF filter, specified as an rffilter object or an lcladder object.
frequencies
— Frequencies to plot magnitude response
vector
Frequencies to plot magnitude response, specified as a vector.
part
— Portion of S-parameters matrix
'triu'
| 'tril'
Portion of the S-parameters matrix, specified as 'triu'
or 'tril'
. Specify triu
to plot the Upper Triangular portion of the matrix and tril
to plot the Lower Triangular portion.
k
— Diagonals to include
0
(default) | scalar
Diagonals to include, specified as a scalar.
k = 0
specifies the main diagonal.k > 0
specifies a diagonal above the main diagonal.k < 0
specifies a diagonal below the main diagonal.
ax
— Axes object
axes
object | uiaxes
object
Axes object, specified as an axes or a uiaxes object.
Output Arguments
collapse all
hline
— Line
line handle
Line containing the S-parameter plot, returned as a line handle.
haxes
— Axes
axes handle
Axes of the rfplot
, returned as an axes handle.
More About
collapse all
Upper Triangular
The upper triangular portion of a matrix includes the main diagonal and all elements above it. The shaded elements in this graphic depict the upper triangular portion of a 6-by-6 matrix.
Lower Triangular
The lower triangular portion of a matrix includes the main diagonal and all elements below it. The shaded elements in this graphic depict the lower triangular portion of a 6-by-6 matrix.
Version History
Introduced before R2006a
expand all
R2022a: Plot S-parameter data with multiple indices
Use the 'diag'
, part, and k input arguments in the rfplot
function to plot S-parameter data with multiple indices.
See Also
smith | rfparam | rfinterp1 | sparameters (Antenna Toolbox) | sparameters | setrfplot
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:
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
- Deutsch
- English
- Français
- United Kingdom (English)
Contact your local office