surf函数

surf函数可以绘制3d图,调用格式为surf(x,y,z,C),其中x和y为自变量,z为关于x和y的函数,z以矩阵形式存在,C可以省略,默认情况下与z相同。
示例:

>>[x,y]=meshgrid(-3:.2:3,-2:.2:2);z=(x.^2-2*x).*exp(-x.^2-y.^2-x.*y);
>>surf(x,y,z)
>>surf(x,y,z,z-10)

这里写图片描述
虽然c为z-10但我没有发现有什么变化 !!!∑(゚Д゚ノ)ノ

MATLAB中的解释为

>> help surf
 SURF   3-D colored surface.
    SURF(X,Y,Z,C) plots the colored parametric surface defined by
    four matrix arguments.  The view point is specified by VIEW.
    The axis labels are determined by the range of X, Y and Z,
    or by the current setting of AXIS.  The color scaling is determined
    by the range of C, or by the current setting of CAXIS.  The scaled
    color values are used as indices into the current COLORMAP.
    The shading model is set by SHADING.

    SURF(X,Y,Z) uses C = Z, so color is proportional to surface height.

    SURF(x,y,Z) and SURF(x,y,Z,C), with two vector arguments replacing
    the first two matrix arguments, must have length(x) = n and
    length(y) = m where [m,n] = size(Z).  In this case, the vertices
    of the surface patches are the triples (x(j), y(i), Z(i,j)).
    Note that x corresponds to the columns of Z and y corresponds to
    the rows.

    SURF(Z) and SURF(Z,C) use x = 1:n and y = 1:m.  In this case,
    the height, Z, is a single-valued function, defined over a
    geometrically rectangular grid.

    SURF(...,'PropertyName',PropertyValue,...) sets the value of the
    specified surface property.  Multiple property values can be set
    with a single statement.

    SURF(AX,...) plots into AX instead of GCA.

    SURF returns a handle to a surface plot object.

    AXIS, CAXIS, COLORMAP, HOLD, SHADING and VIEW set figure, axes, and
    surface properties which affect the display of the surface.

    See also surfc, surfl, mesh, shading.

    Reference page in Help browser
       doc surf
  • 7
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

永远的水面

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值