%1.xiaozao函数,是需要对标准化的序列进行消除数据噪音分析;
%2.Db3函数,是对数列进行Db3趋势分析;
%3.period函数,是求得时间序列的实部和模的平方。
%其中周期变化图是实部的等值线图
%而小波方差是模的平方的算数平均。
clear
%s=load('D:\data\data.txt'); % 输入n*m 55年*84站
%path_out5 = 'D:\xiaoboshuchu\'
load 暴雨量.mat
start_year=1958
a=s(:,1);
b=zscore(a);
scales=[1:1:32];
%进行连续小波变换得到小波系数矩阵,选择复morlet小波函数
wf=cwt(b,scales,'cmor1-1'); %计算小波系数
shibu=real(wf);% 求得系数的实部
mo=abs(wf); %计算小波系数模的绝对值
mofang=mo.^2; %计算小波系数的模方
fangcha=mean(mofang,2); %计算小波方差,小波方差是模的平方的算数平均
%**********画小波实部*************
figure(1);
j = j + 1;
% subplot(121);
% axis([1961,2015,0,50]);
width=713;%宽度,像素数
height=493;%高度
left=300;%距屏幕左下角水平距离
bottem=200;%距屏幕左下角垂直距离
set(gcf,'position',[left,bottem,width,height])
contourf(shibu,10,'-');
colormap('Jet');
colorbar;
hold on
set(gca,'FontSize',13,'Fontname', 'Times New Roman','Fontweight','bold');
xlabel('Year/a','FontName','Times new roman','FontSize',16,'Fontweight','bold');
ylabel('Scales/year','FontName','Times new roman','FontSize',16,'Fontweight','bold');
%set(gca,'XTick',1965:5:2017);
%set(gca,'XTicklabel', 1962:1:2017); %更新XTickLabel
set(gca,'xlim',[1 length(s)],'XTick',1:roundn(length(s)/5,0):length(s),'XTickLabel',start_year:roundn(length(s)/5,0):(start_year+length(s)-1))%修改横坐标的范围
title('(a)','Fontname','Times new roman','FontSize',18,'Fontweight','bold','position',[-4,52]);
%saveas(gca,[path_out5,num2str(j)],'png');
%close;
%********小波方差*************%
figure(2);
j = j + 1;
width=713;%宽度,像素数
height=493;%高度
left=300;%距屏幕左下角水平距离
bottem=200;%距屏幕左下角垂直距离
set(gcf,'position',[left,bottem,width,height])
% subplot(122);
plot(fangcha,'k-','linewidth',1.5);
set(gca,'FontName','Times new roman','FontSize',16,'Fontweight','bold');
xlabel('Scales/year','FontName','Times new roman','FontSize',16,'Fontweight','bold');
ylabel('Variance','FontName','Times new roman','FontSize',16,'Fontweight','bold');
title('(b)','Fontname','Times new roman','FontSize',18,'Fontweight','bold','position',[-3,1.8]);
set(gca,'XTick',0:5:31);
axis([1 32 0 2]);
grid on;
%saveas(gca,[path_out5,num2str(j)],'png');
%close;
%********小波模**************%
figure(3);
j = j + 1;
%subplot(122);
width=713;%宽度,像素数
height=493;%高度
left=300;%距屏幕左下角水平距离
bottem=200;%距屏幕左下角垂直距离
set(gcf,'position',[left,bottem,width,height])
contourf(mo,10,'-');
colormap('Jet');
colorbar;
hold on
set(gca,'FontName','Times new roman','FontSize',13,'Fontweight','bold');
xlabel('Year','FontName','Times new roman','FontSize',16,'Fontweight','bold');
ylabel('Scales/year','FontName','Times new roman','FontSize',16,'Fontweight','bold');
title('(c)','Fontname','Times new roman','FontSize',18,'Fontweight','bold','position',[-4,52]);
set(gca,'xlim',[1 length(s)],'XTick',1:roundn(length(s)/5,0):length(s),'XTickLabel',start_year:roundn(length(s)/5,0):(start_year+length(s)-1))
%saveas(gca,[path_out5,num2str(j)],'png');
%close;
%********小波模方**************%
figure(4);
j = j + 1;
%subplot(122);
width=713;%宽度,像素数
height=493;%高度
left=300;%距屏幕左下角水平距离
bottem=200;%距屏幕左下角垂直距离
set(gcf,'position',[left,bottem,width,height])
contourf(mofang,10,'-');
colormap('Jet');
colorbar;
hold on
set(gca,'FontName','Times new roman','FontSize',13,'Fontweight','bold');
xlabel('Year','FontName','Times new roman','FontSize',16,'Fontweight','bold');
ylabel('Scales/year','FontName','Times new roman','FontSize',16,'Fontweight','bold');
set(gca,'xlim',[1 length(s)],'XTick',1:roundn(length(s)/5,0):length(s),'XTickLabel',start_year:roundn(length(s)/5,0):(start_year+length(s)-1))
%saveas(gca,[path_out5,num2str(j)],'png');
气象数据小波分析matlab代码
需积分: 50 92 浏览量
2020-11-12
17:13:19
上传
评论 46
收藏 2KB RAR 举报
小米米稳如poi
- 粉丝: 12
- 资源: 5
最新资源
- C语言基础-C语言编程基础之Leetcode编程题解之第39题组合总和.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第38题外观数列.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第37题解数独.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第36题有效的数独.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第35题搜索插入位置.zip
- index.wxml
- C语言基础-C语言编程基础之Leetcode编程题解之第33题搜索旋转排序数组.zip
- 基于Python实现的手写数字识别系统源码.zip
- 从网页提取禁止转载的文字
- C语言基础-C语言编程基础之Leetcode编程题解之第32题最长有效括号.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0