Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

ezsurf

(非推奨) 3 次元表面のプロット

ezsurf は推奨されません。代わりに fsurf を使用してください。

説明

ezsurf(f) は、2 変数シンボリック式または関数 f(x,y)-2*pi < x < 2*pi-2*pi < y < 2*pi の範囲にわたってプロットします。

ezsurf(f,[xmin,xmax]) は、指定された範囲 xmin < x < xmaxf(x,y) をプロットします。これは、横座標 (水平軸) に沿った範囲です。

ezsurf(f,[xmin,xmax,ymin,ymax]) は、横座標 xmin < x < xmax と縦座標 ymin < y < ymax に沿って、指定された範囲に f(x,y) をプロットします。

範囲値を決定する際、ezsurf は変数をアルファベット順に並べ替えます。たとえば、ezsurf(x^2 - a^3, [0,1,3,6])x^2 - a^30 < a < 13 < x < 6 の範囲にわたってプロットします。

ezsurf(x,y,z) はパラメトリックな表面 x = x(s,t)y = y(s,t)z = z(s,t)-2*pi < s < 2*pi-2*pi < t < 2*pi の範囲にわたってプロットします。

ezsurf(x,y,z,[smin,smax]) はパラメトリックな表面 x = x(s,t)y = y(s,t)z = z(s,t) を指定された範囲 smin < s < smax でプロットします。

ezsurf(x,y,z,[smin,smax,tmin,tmax]) はパラメトリックな表面 x = x(s,t)y = y(s,t)z = z(s,t) を指定された範囲 smin < s < smax および tmin < t < tmax でプロットします。

ezsurf(___,n) はグリッドを指定します。上記のいずれの構文でも、入力引数の後に n を指定できます。既定では、n = 60 です。

ezsurf(___,'circ') は範囲を中心とした円上に表面プロットを作成します上記のいずれの構文でも、入力引数の後に 'circ' を指定できます。

h = ezsurf(___) は表面プロット オブジェクトにハンドル h を返します。これまでに説明した構文のいずれでも出力引数 h を使用できます。

すべて折りたたむ

シンボリック関数 f(x,y) = real(atan(x + i*y)) を既定の範囲 -2*pi < x < 2*pi-2*pi < y < 2*pi にわたってプロットします。

シンボリック関数を作成します。

syms f(x,y)
f(x,y) = real(atan(x + i*y));

ezsurf を使用してこの関数をプロットします。

ezsurf(f)

Figure contains an axes object. The axes object with title real ( atan ( x blank + blank y blank 1i )), xlabel x, ylabel y contains an object of type surface.

シンボリック式 x^2 + y^2-1 < x < 1 の範囲にわたってプロットします。y 軸は範囲が指定されていないため、ezsurf によって自動的に選択されます。

syms x y
ezsurf(x^2 + y^2, [-1, 1])

Figure contains an axes object. The axes object with title x Squared baseline blank + blank y Squared baseline, xlabel x, ylabel y contains an object of type surface.

両軸の範囲を指定します。

ezsurf(x^2 + y^2, [-1, 1, -0.5, 1.5])

Figure contains an axes object. The axes object with title x Squared baseline blank + blank y Squared baseline, xlabel x, ylabel y contains an object of type surface.

パラメトリックな表面 x(s,t), y(s,t), z(s,t) を次のように定義します。

syms s t
r = 2 + sin(7*s + 5*t);
x = r*cos(s)*sin(t);
y = r*sin(s)*sin(t);
z = r*cos(t);

ezsurf を使用して関数をプロットします。

ezsurf(x, y, z, [0, 2*pi, 0, pi])
title('Parametric surface')

Figure contains an axes object. The axes object with title Parametric surface, xlabel x, ylabel y contains an object of type surface.

より滑らかなプロットを作成するため、メッシュ点の数を増やします。

ezsurf(x, y, z, [0, 2*pi, 0, pi], 120)
title('Parametric surface with grid = 120')

Figure contains an axes object. The axes object with title Parametric surface with grid = 120, xlabel x, ylabel y contains an object of type surface.

最初に、式 sin(x^2 + y^2) を正方範囲 -pi/2 < x < pi/2-pi/2 < y < pi/2 にわたってプロットします。

syms x y
ezsurf(sin(x^2 + y^2), [-pi/2, pi/2, -pi/2, pi/2])

Figure contains an axes object. The axes object with title sin ( x Squared baseline blank + blank y Squared baseline ), xlabel x, ylabel y contains an object of type surface.

次に、同じ式を円形範囲でプロットします。

ezsurf(sin(x^2 + y^2), [-pi/2, pi/2, -pi/2, pi/2],'circ')

Figure contains an axes object. The axes object with title sin ( x Squared baseline blank + blank y Squared baseline ), xlabel x, ylabel y contains an object of type surface.

シンボリック式 sin(x)cos(x) をプロットし、結果をハンドル h に割り当てます。

syms x y
h = ezsurf(sin(x)*cos(y), [-pi, pi])

Figure contains an axes object. The axes object with title cos ( y ) blank sin ( x ), xlabel x, ylabel y contains an object of type surface.

h = 
  Surface with properties:

       EdgeColor: [0 0 0]
       LineStyle: '-'
       FaceColor: 'flat'
    FaceLighting: 'flat'
       FaceAlpha: 1
           XData: [60x60 double]
           YData: [60x60 double]
           ZData: [60x60 double]
           CData: [60x60 double]

  Use GET to show all properties

このハンドルを使用して、プロットのプロパティを変更することができます。たとえば、領域の輪郭の色を変更します。

h.EdgeColor = 'red'

Figure contains an axes object. The axes object with title cos ( y ) blank sin ( x ), xlabel x, ylabel y contains an object of type surface.

h = 
  Surface with properties:

       EdgeColor: [1 0 0]
       LineStyle: '-'
       FaceColor: 'flat'
    FaceLighting: 'flat'
       FaceAlpha: 1
           XData: [60x60 double]
           YData: [60x60 double]
           ZData: [60x60 double]
           CData: [60x60 double]

  Use GET to show all properties

入力引数

すべて折りたたむ

プロット対象の関数。2 変数のシンボリック式またはシンボリック関数として指定します。

例: ezsurf(x^2 + y^2)

プロット対象のパラメトリック関数。 2 変数の 3 つのシンボリック式またはシンボリック関数として指定します。

例: ezsurf(s*cos(t), s*sin(t), t)

グリッド値。整数として指定します。既定のグリッド値は 60 です。

出力引数

すべて折りたたむ

表面プロット ハンドル。スカラーとして返されます。これは一意な識別子であり、これを使用した表面プロットのプロパティのクエリと変更が可能です。

ヒント

  • ezsurf は、生じる変動量に従って計算グリッドを選択します。f がグリッド上の点に対して特異値となる場合、ezsurf はこれらの点を省略します。これらの点の値は NaN に設定されます。

バージョン履歴

R2006a より前に導入