Main Content

semilogx

Plot RF circuit object parameters using log scale for x-axis

Description

semilogx(h,circuitPara) plots the circuit parameter circuitPara from the RFCKT or RF data object h using a logarithmic scale for the x-axis. You can specify multiple circuit parameters in this syntax.

Note

For all circuit objects except those that contain data from a data file, you must perform a frequency domain analysis with the analyze method before calling semilogx.

example

semilogx(h,circuitPara,dataFormat) plots the data of the RFCKT or RF data object using a logarithmic scale for the x-axis with the specified data format.

semilogx(___,xAxisPara,xAxisFmt) plots the circuit parameters circuitPara using a logarithmic scale for the x-axis along with the variables xAxisPara and their corresponding format xAxisFmt. Specify xAxisPara and xAxisFmt arguments after any of the input argument combinations in the previous syntaxes.

example

semilogx(___,opCon,opVal) plots the circuit parameters using a logarithmic scale for the x-axis with operating conditions opCon and operating values opVal for the circuit object h.

Derive operating conditions for the RFCKT or RF data object h using the getop(h) command.

semilogx(___,Name,Value) plots the data of a RFCKT or RF data object with name-value arguments. Specify name-value argument after any of the input argument combinations in the previous syntaxes.

example

lineseries = semilogx(___) returns the line series property object lineseries. This output is the same as the output returned by the MATLAB® semilogx function.

example

Examples

collapse all

Create an amplifier object from default.s2p file.

h = read(rfckt.amplifier,'default.s2p');

Plot S11 and S21 using log scale on x-axis.

lineseries = semilogx(h,'S11','S21')
lineseries = 
  2x1 Line array:

  Line    (S_{11})
  Line    (S_{21})

Change the color of the S11 data.

lineseries(1).Color = [0.4 0 1];

Figure contains an axes object. The axes object with xlabel Freq [GHz], ylabel Magnitude (decibels) contains 2 objects of type line. These objects represent S_{11}, S_{21}.

Create an RFCKT amplifier object from the specified P2D file type.

h = read(rfckt.amplifier,'default.p2d');

Plot the output power of the amplifier.

semilogx(h,'Pout')

Figure contains an axes object. The axes object with xlabel P indexOf in baseline [dBm], ylabel dBm contains 3 objects of type line. These objects represent P_{out}(Freq=1[GHz];Bias=1.5), P_{out}(Freq=2.1[GHz];Bias=1.5), P_{out}(Freq=2.9[GHz];Bias=1.5).

Plot the output power of the amplifier and set the format for Pin in milliwatts.

semilogx(h,'Pout','Pin','mW')

Figure contains an axes object. The axes object with xlabel P indexOf in baseline [mW], ylabel dBm contains 3 objects of type line. These objects represent P_{out}(Freq=1[GHz];Bias=1.5), P_{out}(Freq=2.1[GHz];Bias=1.5), P_{out}(Freq=2.9[GHz];Bias=1.5).

Plot the output power of the amplifier at 2.4 GHz.

semilogx(h,'Pout','Pin','mW','bias',1.5,'Freq',2.4e9)

Figure contains an axes object. The axes object with xlabel P indexOf in baseline [mW], ylabel dBm contains an object of type line. This object represents P_{out}(Freq=2.4[GHz];Bias=1.5).

Input Arguments

collapse all

RFCKT or RF data object, specified as a rfckt or rfdata object.

For complete list of RFCKT and RF data objects, see RF Circuit Objects and RF Data Objects.

Format of the data to be plotted, specified as character vector or string scalar. Type listformat(h,circuitPara) command to see the available formats for a specified parameter.

Example: lineseries = semilogy(h,'Pout','dBm')

Valid RFCKT or data object parameter, specified as a character vector or string scalar.

Use listparam(h) for a list of valid parameters for the circuit or data object h.

X-axis variable to plot with the circuit parameters, circuitPara, specified as a character vector or string scalar.

This table shows the commonly used circuitPara and their corresponding xAxisPara values. The function uses the default values listed in the table if you do not specify xAxisPara.

circuitPara ValuexAxisPara Value
Pout, Phase, LS11, LS12, LS21, LS22Pin (default), Freq
S11, S12, S21, S22, NF, IIP3, OIP3, GroupDelay, VSWRIn, VSWROut, GammaIn, GammaOut, FMIN, GammaOPT, RN, TF1, TF2, Gt, Ga, Gp, Gmag, Gmsg, GammaMS, GammaML, K, Delta, Mu, MuPrimeFreq
AM/AM, AM/PMAM

xAxisPara format, specified as a character vector or string scalar. You do not need to specify xAxisFmt when xAxisPara is an operating condition.

This table shows the commonly used xAxisPara and their corresponding xAxisFmt. The function uses the default values listed in the table if you do not specify xAxisFmt.

xAxisPara ValuexAxisFmt Value
PindBm (default), mW, W, dBW
Freq

THz, GHz, MHz, KHz, Hz

By default, xAxisFmt is chosen to provide the best scaling for the given xAxisPara values.

AMMagnitude (decibels) (default), Magnitude (linear)

Example: semilogx(h,'Pout','Pin','mW') plots data using a logarithmic scale for the x-axis for circuit object, h, with xAxisPara set to 'Pin' and xAxisFmt set to 'mW'.

Operating conditions derived from a P2D or S2D file, specified as a string scalar or a character vector.

For some circuit parameters, you can specify a set of frequency or input power values at which the function plots the specified parameter.

For example:

  • When plotting large-signal S-parameters as a function of input power, you can specify frequency points of interest using opCon and opVal arguments.

  • When plotting large-signal S-parameters as a function of frequency, you can specify input power levels of interest using opCon and opVal arguments.

  • When plotting parameters as a function of an operating condition, you can specify both frequency and input power values using opCon and opVal arguments.

Enter the getop(h) command at the command line to get the operating conditions for the RF circuit object h.

Value of the operating conditions specified using the opCon argument, specified as a scalar.

Example: semilogx(h,'Pout','Pin','mW','bias',1.5) plots the data using a logarithmic scale for the x-axis for circuit object, h, with opCon set to 'bias' and value set to 1.5.

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: semilogx(h,'Pout','Pin','mW','bias',1.5,'Freq',2.4)

Frequency value used to plot the data using a logarithmic scale for the x-axis, specified as the comma-separated pair consisting of 'Freq' and a positive scalar in Hz.

Input power level used to plot the data using a logarithmic scale for the x-axis, specified as the comma-separated pair consisting of 'Pin' and a scalar in dBm.

Output Arguments

collapse all

Lineseries object, returned as a column vector of object handles.

Tips

  • Use the Property Editor (propertyeditor) or the MATLAB set function to change Line Properties.

    Note

    Use the MATLAB semilogx function to create a semi-log scale plot of network parameters that are specified as vector data and are not part of a circuit (rfckt) object or data (rfdata) object.

Version History

Introduced in R2007a