ezsurf
(不建议)易于使用的3D彩色表面绘图仪
ezsurf
is not recommended. Usefsurf
instead.
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 specifieddomain
。domain
must 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
网格。的默认值n
is 60.
ezsurf(...,'circ')
情节乐趣
在一个磁盘以域为中心。
ezsurf(axes_handle,...)
情节into the axes with handleaxes_handle
instead of the current axes (gca
).
h = ezsurf(...)
returns the handle to a surface object inh
。
Examples
提示
ezsurf
和ezsurfc
不要接受复杂的输入。
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^2
is interpreted asx.^2
在角色向量或字符串中ezsurf
。
如果要绘制的函数是变量的函数u和v(rather thanx和y),然后域端点嗯
,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 handlefh
toezsurf
。
fh = @(x,y) sqrt(x.^2 + y.^2); ezsurf(fh)
请注意,使用函数句柄时,您必须使用数组功率,数组乘法和数组划分运算符(。^, .*, ./
) sinceezsurf
does not alter the syntax, as in the case with character vector or string inputs.
通过其他参数
If your function has additional parameters, for examplek
inmyfun
:
乐趣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))
算法
ezsurf
determines 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, [ ]),ezsurf
interprets it as then
, the number of points desired between the axes最大限度
和min
values.
By default,ezsurf
uses 60 points between the最大限度
和min
values of an axes. When themin
和最大限度
值是默认值(r = [-2*pi,2*pi,-2*pi,2*pi];
),ezsurf
确保60点落在指定方程的非复合范围内。例如,
只有在
。这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
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, butezsurf
used 60 points between the user-defined limits instead of checking to see if all those points would have real answers.