楼主: iloveinru
13160 1

[求助]matlab里面的smooth怎么用?貌似不对 [推广有奖]

  • 0关注
  • 0粉丝

学前班

80%

还不是VIP/贵宾

-

威望
0
论坛币
41 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
101 点
帖子
5
精华
0
在线时间
0 小时
注册时间
2006-11-20
最后登录
2014-5-6

楼主
iloveinru 发表于 2008-4-30 08:21:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

我想取一个移动平均,也就是ma了,然后用smooth(x,5),结果发现样本一点没变

取样本x=1:10,smooth(x,5),结果还是x,不知道怎么回事啊,哪位大侠指点下啊

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:MATLAB smooth matla atlab Mat MATLAB smooth

沙发
matlab-007 发表于 2015-1-24 20:06:51
help smooth
SMOOTH  Smooth data.
    Z = SMOOTH(Y) smooths data Y using a 5-point moving average.
    Z = SMOOTH(Y,SPAN) smooths data Y using SPAN as the number of points used
    to compute each element of Z.
    Z = SMOOTH(Y,SPAN,METHOD) smooths data Y with specified METHOD. The
    available methods are:
            'moving'   - Moving average (default)
            'lowess'   - Lowess (linear fit)
            'loess'    - Loess (quadratic fit)
              'sgolay'   - Savitzky-Golay
            'rlowess'  - Robust Lowess (linear fit)
            'rloess'   - Robust Loess (quadratic fit)
    Z = SMOOTH(Y,METHOD) uses the default SPAN 5.
    Z = SMOOTH(Y,SPAN,'sgolay',DEGREE) and Z = SMOOTH(Y,'sgolay',DEGREE)
    additionally specify the degree of the polynomial to be used in the
    Savitzky-Golay method. The default DEGREE is 2. DEGREE must be smaller
    than SPAN.
    Z = SMOOTH(X,Y,...) additionally specifies the X coordinates.  If X is
    not provided, methods that require X coordinates assume X = 1:N, where
    N is the length of Y.
    Notes:
    1. When X is given and X is not uniformly distributed, the default method
    is 'lowess'.  The 'moving' method is not recommended.
    2. For the 'moving' and 'sgolay' methods, SPAN must be odd.
    If an even SPAN is specified, it is reduced by 1.
    3. If SPAN is greater than the length of Y, it is reduced to the
    length of Y.
    4. In the case of (robust) lowess and (robust) loess, it is also
    possible to specify the SPAN as a percentage of the total number
    of data points. When SPAN is less than or equal to 1, it is
    treated as a percentage.
    For example:
    Z = SMOOTH(Y) uses the moving average method with span 5 and
    X=1:length(Y).
    Z = SMOOTH(Y,7) uses the moving average method with span 7 and
    X=1:length(Y).
    Z = SMOOTH(Y,'sgolay') uses the Savitzky-Golay method with DEGREE=2,
    SPAN = 5, X = 1:length(Y).
    Z = SMOOTH(X,Y,'lowess') uses the lowess method with SPAN=5.
    Z = SMOOTH(X,Y,SPAN,'rloess') uses the robust loess method.
    Z = SMOOTH(X,Y) where X is unevenly distributed uses the
    'lowess' method with span 5.
    Z = SMOOTH(X,Y,8,'sgolay') uses the Savitzky-Golay method with
    span 7 (8 is reduced by 1 to make it odd).
    Z = SMOOTH(X,Y,0.3,'loess') uses the loess method where span is
    30% of the data, i.e. span = ceil(0.3*length(Y)).

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-20 06:55