爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3777|回复: 2

[源程序] 求助小波分析的问题

[复制链接]
发表于 2015-8-22 22:13:27 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
小弟是matlab爱好者,但困于知识有限,只能傻瓜式的到家园下载程序,但是运用自己的数据时候就出现问题 不知道需要修改哪里,还望各位大神指教,小弟在此先谢过,呵呵!程序如下:

clear
load q.txt
zf=q;
t=[1951:2014];% t根据数据修改,岂止年份根据数据修改
figure(1);
subplot(1,1,1);
index=1951:2014;% 年份根据数据修改
t=1:65;% t根据数据修改
c1=cwt(zf,[1:1:65],'morl','plot');%(morl是Morlet小波,mexh为墨西哥帽小波)
contourf(index,t,c1,60);%(50是等值线条数,可以修改)
colormap(jet);
xlabel('年份');ylabel('尺度');
title('MORLET时频分布图');
colorbar('EASTOUTSIDE');
print(gcf,'-djpeg','MORLET时频分布图');
figure(2);%绘制小波时频分析图
subplot(1,1,1);
contourf(index,t,c1,25);
colormap(Jet);
xlabel('年份');ylabel('尺度');
title('MORLET小波实部时频分布等高线');
colorbar('EASTOUTSIDE');
print(gcf,'-djpeg','MORLET时频Coef时频分布等高线');

figure(3);%绘制立体图
subplot(1,1,1);
meshc(c1);
surfc(c1);
shading interp;colormap(jet);
xlabel('年份');ylabel('尺度');zlabel('MORLET小波变换系数Coef');
title('MORLET小波变换系数时频分布立体图');
colorbar('EASTOUTSIDE');
print(gcf,'-djpeg','MORLET时频Coef时频分布立体图');

figure(4);
y=var(c1);%小波方差
plot(y);
title('小波方差图');
ylabel('Morlet小波方差');xlabel('年份');
grid;

figure(5);
subplot(1,1,1);
b=(abs(c1)).^2;%小波系数摸平方
[c,h]=contourf(index,t,b,25);
colormap(Jet);
ylabel('尺度');xlabel('年份');
title('小波系数模平方');
数据如下:
1951
839.5
1952
991.3
1953
909.7
1954
908.5
1955
1028.2
1956
986.9
1957
956
1958
956.7
1959
815.9
1960
845.3
1961
852
1962
1005
1963
1213.3
1964
952.7
1965
1096.3
1966
1098.5
1967
842.5
1968
1058.5
1969
792.8
1970
904.8
1971
1033.9
1972
845.1
1973
940.1
1974
944.4
1975
976.5
1976
758.7
1977
775.4
1978
1175
1979
974.7
1980
994.3
1981
901.5
1982
861
1983
648.1
1984
867.9
1985
923.7
1986
998.2
1987
1090.1
1988
824.2
1989
1137.5
1990
1133.3
1991
1083.5
1992
789.9
1993
1102.5
1994
842.9
1995
995.2
1996
1059.4
1997
800.6
1998
1215.2
1999
1283.4
2000
1063.6
2001
1130.7
2002
1165.4
2003
897.2
2004
1119.3
2005
830.6
2006
859.4
2007
1054
2008
918.5
2009
821.8
2010
989.8
2011
808
2012
655
2013
896.3
2014
915.3





密码修改失败请联系微信:mofangbao
发表于 2015-8-23 10:45:37 | 显示全部楼层
自己多耗点时间弄懂吧
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-8-23 13:43:38 | 显示全部楼层
哎,没有人指导吗
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表