Documentation

ezsurf

(不建议)易于使用的3D彩色表面绘图仪

ezsurfis not recommended. Usefsurfinstead.

Syntax

ezsurf(娱乐)
ezsurf(fun,domain)
ezsurf(funx,funy,funz)
ezsurf(funx,funy,funz,[smin,smax,tmin,tmax])
ezsurf(funx,funy,funz,[min,max])
ezsurf(...,n)
ezsurf(...,'circ')
ezsurf(axes_handle,...)
h = ezsurf(...)

Description

ezsurf(娱乐)creates a graph of娱乐(x,y)使用surf乐趣ction.乐趣is plotted over the default domain: -2π <x<2π,-2π<y< 2π.

乐趣can be a function handle, a character vector, or a string (see the提示section).

ezsurf(fun,domain)情节乐趣over the specifieddomaindomainmust be a vector. See the算法section for details on vector inputs vs axes limit outputs.

ezsurf(funx,funy,funz)绘制参数表面Funx(S,T),乐趣y(s,t), 和乐趣z(s,t)over the square: -2π <s<2π,-2π<t< 2π.

ezsurf(funx,funy,funz,[smin,smax,tmin,tmax])或者ezsurf(funx,funy,funz,[min,max])绘制参数表面使用specified domain.

ezsurf(...,n)情节乐趣使用一个默认域使用n-经过-n网格。的默认值nis 60.

ezsurf(...,'circ')情节乐趣在一个磁盘以域为中心。

ezsurf(axes_handle,...)情节into the axes with handleaxes_handleinstead of the current axes (gca).

h = ezsurf(...)returns the handle to a surface object inh

Examples

collapse all

绘制功能over the domain。这ezsurf函数不会绘制未定义数学函数的点。这些要点设置为NaN这样他们就不会绘制。

figure ezsurf('real(atan(x+i*y))')

利用surf绘制相同的数据而不过滤不连续性。

图[x,y] = meshgrid(linspace(-2*pi,2*pi,60));z = real(atan(x+1i。*y));冲浪(X,Y,Z)

提示

ezsurfezsurfc不要接受复杂的输入。

Passing the Function as a Character Vector or String

在您传递给ezsurf。例如,matlab®syntax for a surface plot of the expression

sqrt(x.^2 + y.^2);

被写成

ezsurf('sqrt(x^2 + y^2)')

That is,x^2is interpreted asx.^2在角色向量或字符串中ezsurf

如果要绘制的函数是变量的函数uv(rather thanxy),然后域端点,umax,vmin, 和vmax按字母顺序排序。因此,ezsurf('u^2 - v^3',[0,1],[3,6])情节u2-v3over 0 <u<1,3 <v< 6.

Passing a Function Handle

Function handle arguments must point to functions that use MATLAB syntax. For example, the following statements define an anonymous function and pass the function handlefhtoezsurf

fh = @(x,y) sqrt(x.^2 + y.^2); ezsurf(fh)

请注意,使用函数句柄时,您必须使用数组功率,数组乘法和数组划分运算符(。^, .*, ./) sinceezsurfdoes not alter the syntax, as in the case with character vector or string inputs.

通过其他参数

If your function has additional parameters, for examplekinmyfun:

乐趣ction z = myfun(x,y,k1,k2,k3) z = x.*(y.^k1)./(x.^k2 + y.^k3);

then you can use an anonymous function to specify that parameter:

ezsurf(@(x,y)myfun(x,y,2,2,4))

算法

ezsurfdetermines thex-y-axes limits in different ways depending on how you input the domain (if at all). In the following table,R是矢量[xmin,xmax,ymin,ymax] andv是手动输入的域向量。

指定的域值数: Resulting domain vector:
v = [ ];
r = [-2*pi,2*pi,-2*pi,2*pi];
v = [ v(1) ];
R = double([-abs(v),abs(v),-abs(v),abs(v)]);
v = [ v(1) v(2) ];
R = double([v(1),v(2),v(1),v(2)]);
V = [V(1)V(2)V(3)];
r = double([ -  v(1),v(2), -  abs(v(3)),abs(v(v(3))]);
v = [ v(1) v(2) v(3) v(4) ];
R = double(v);
v = [ v(1)..v(n) ];n>4
R = double([-abs(v(1)), abs(v(1)), -abs(v(1)), abs(v(1))]);

If you specify a single number in non-vector format (without square brackets, [ ]),ezsurfinterprets it as then, the number of points desired between the axes最大限度minvalues.

By default,ezsurfuses 60 points between the最大限度minvalues of an axes. When themin最大限度值是默认值(r = [-2*pi,2*pi,-2*pi,2*pi];),ezsurf确保60点落在指定方程的非复合范围内。例如, 1 x 2 y 2 只有在 x 2 y 2 1 。这default graph of this function looks like this:

ezsurf('sqrt(1-x^2-y^2)')

You can see that there are 60 points between the minimum and maximum values for which 1 x 2 y 2 has real values. However, when you specify the domain values to be the same as the default (r = [-2*pi,2*pi,-2*pi,2*pi];), a different result appears:

ezsurf('sqrt(1-x^2-y^2)',[-2*pi 2*pi])

In this case, the graphic limits are the same, butezsurfused 60 points between the user-defined limits instead of checking to see if all those points would have real answers.

在R2006a之前引入

这个话题有帮助吗?