ezplot

ezplot

ezplot用於繪製符號函式圖形,在matlab的命令視窗中鍵入help ezplot命令或者doc ezplot即可獲得本函式的幫助信息。

基本介紹

  • 中文名:繪製符號函式圖形
  • 外文名:ezplot
  • 類別:計算機編程
  • 屬於:MATLAB編程
  • 英文全稱:Easy-to-use function plotter
功能簡介,調用格式,函式說明,套用示例,

功能簡介

ezplot即:Easy to use function plotter。它是一個易用的一元函式繪圖函式 。特別是在繪製含有符號變數的函式的圖像時,ezplot要比plot更方便。因為plot繪製圖形時要指定自變數的範圍,而ezplot無需數據準備,直接繪出圖形。

調用格式

ezplot(fun)
ezplot(fun,[xmin,xmax])
ezplot(fun2)
ezplot(fun2,[xymin,xymax])
ezplot(fun2,[xmin,xmax,ymin,ymax])
ezplot(funx,funy)
ezplot(funx,funy,[tmin,tmax])
ezplot(...,figure_handle)
ezplot(axes_handle,...)
h = ezplot(...)

函式說明

1、ezplot(fun)在默認區間-2π< x < 2π 繪製函式fun(x)的圖像,其中fun(x)是x的一個顯函式。fun可以是一個函式句柄或者字元。
2、ezplot(fun,[xmin,xmax])在區間 xmin <x< xmax 繪製函式fun(x)。
3、對於一個隱函式fun2(x,y):
ezplot(fun2)在默認區間-2π <x<2π, -2π <y< 2π 繪製fun2(x,y)=0。
4、ezplot(fun2,[xymin,xymax]) 在xymin < x < xymax和xymin < y < xymax 範圍內繪製fun2(x,y)=0圖像。
5、ezplot(fun2,[xmin,xmax,ymin,ymax]) 在xmin < x < xmax和ymin < y < ymax 範圍內繪製fun2(x,y)=0圖像。
6、ezplot(funx,funy)在默認區間0 < t < 2π 繪製參數定義的平面曲線funx(t)和funy(t).
7、ezplot(funx,funy,[tmin,tmax])在默認區間tmin < t < tmax繪製參數定義的平面曲線funx(t)和funy(t).
8、ezplot(...,figure_handle)在句柄圖像定義的圖像視窗繪製特定區間的給定函式圖像。
9、ezplot(axes_handle,...)用坐標軸句柄繪製而不是當前坐標軸句柄(gca)繪製函式圖像。
10、h = ezplot(...)返回所有繪製圖像的句柄。

套用示例

例一:這個例子通過繪製正弦圖形來對ezplot和plot進行比較。使用plot繪製正弦圖形的命令語句:
ezplot畫正弦曲線ezplot畫正弦曲線
x=[-pi:0.01:pi];
y=sin(x);
plot(x,y)
使用fplot(針對建立的數值函式):
y=inline('sin(x)');
fplot(y,[-pi,pi])
使用ezplot(針對符號函式):
syms x;
y=sin(x);
ezplot(y)
例二:
繪製y=x^2;的圖形,其中x為符號變數。syms x;
ezplot畫y=x^2的圖形ezplot畫y=x^2的圖形
y=x^2;
ezplot(y)
例三:
繪製x^2=y^4圖像並且x=[-2π, 2π],y=[-2π, 2π],
代碼為 ezplot('x^2=y^4',[-2*pi,2*pi,-2*pi,2*pi])
例四:
繪製由符號函式聲明的參數方程x=1+cos(t),y=-2+2sin(t)所確定的橢圓:
syms t;
x=1+cos(t);
y=2*sin(t)-2;
ezplot(x,y);

相關詞條

熱門詞條

聯絡我們