當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


MATLAB Semilogx()用法及代碼示例

它使用 x 的對數刻度和 y 的線性刻度生成 x 和 y 值的圖。

用法

semilogx(Y)  //  It generates a plot using a base 10 logarithmic scale for the x-axis and a linear scale for the y-axis. It plots the column of Y versus their index. The values in Y can be numerical, datetime, duration, or categorical values.
semilogx(X1,Y1,...) //  It plots all Yn versus Xn pairs. 
semilogx(X1,Y1,LineSpec,...) // It plots all the lines described by the Xn,Yn,LineSpec triples. LineSpec determine line style, marker symbol, and color of the plotted lines.
semilogx(...,'PropertyName',PropertyValue,...)// It sets property values for all charting lines created by semilogx.
semilogx(ax,...)// It generates the line in the axes specified by ax instead of in the current axes (gca). The option ax precedes any of the input argument combination in the previous syntax.
h = semilogx(...)//   It return a vector of chart line objects.

示例

創建一個圖,其中 x 軸為對數刻度,y 軸為線性刻度。

x=e^-t,y=t,0≤t≤2π
t=linspace (0,2*pi,200);
x=exp(-t);
y=t;
semilogx (x, y), grid

輸出:

MATLAB Semilogx()



相關用法


注:本文由純淨天空篩選整理自 MATLAB Semilogx()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。