matlab 叠加 area,MATLAB函数area()

面积图将Y中的项目显示为一条或多条曲线, 并填充每条曲线下方的区域。当Y为矩阵时, 曲线将堆叠起来, 以每个x间隔显示每个行项目对曲线总高度的相对贡献。

句法

area(Y) // It plot the vector Y or the sum of the each column in a matrix Y. The x-axis automatically scales depending on the length(Y) when Y is the vector and on size(Y, 1)when Y is the matrix.

area(X, Y) // It plot Y at the corresponding values of X. If X is a vector, length(X) must be the same length(Y), and X must be the monotonic. If X is the matrix, size(X) must similar size(Y), and each column in X must be monotonic.

area(..., ymin) // It specifies the lower limit in the y-direction for the area fill. The default ymin is 0.

area(..., 'PropertyName', PropertyValue, ...) // It specifies property name and property value pairs for the patch graphics object developed by area.

h = area(...) // It returns handles of patch graphics objects. area generates one patch object per column in Y.

例子

y=sinx/x, -3π≤x≤3π

x=linspace (-3*pi, 3*pi, 100);

y=-sin(x)./x;

area(x, y)

xlabel('x'), ylabel('sin(x)./x')

hold on

x1=x(46:55);y1=y(46:55);

area(x1, y1, 'facecolor', 'y')

输出

matlab-2d-area-output.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值