- 积分
- 740
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-4-22
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位亲爱的老师,大神们,能不能帮我看一个,我这个程序是出的什么图和怎么用的
clear;
data=xlsread('E:\date\haikou.xlsx');
line=data(:,1);
k=find(line>=254);
for i=1:1:1098
if i==1098
n1=k(i,1)+4;
n2=23670;
else
n1=k(i,1)+4;
n2=k(i+1,1)-1;
end;
bj{i}=data(n1:n2,:);
end;
for i=3:3:1097
bj{i}=bj{i+1};
end;
bj{1098}=nan;
% date
load e:\work\station\zdz1.mat
for i=1:1:366*24
date(i,1)=str2num(zdz1{i,2}(1:8));
end;
date1=reshape(date,24,366);
date2=date1(1,:)';
for i=1096:3:1098
a1=bj{i};
a2=bj{i+1};
a3=bj{i+2};
m1=find(a1==99999);
a1(m1)=nan;
m2=find(a2==99999);
a2(m2)=nan;
m3=find(a3==99999);
a3(m3)=nan;
f1=find(a1(:,2)==3000);
f2=find(a2(:,2)==3000);
% f3=find(a3(:,2)==3000);
[m1,n1]=size(a1);
[m2,n2]=size(a2);
[m3,n3]=size(a3);
if length(f1)==0
f1=m1;
end;
if f2==0
f2=m2;
end;
% if f3==0
% f3=m3;
% end;
d1=a1([1:f1],:);
d2=a2([1:f2],:);
% d3=a3([1:f3],:);
% wd
figure
plot(d1(:,6),d1(:,2)/10,'-k','LineWidth',2,'MarkerFaceColor','w')
hold on
plot(d2(:,6),d2(:,2)/10,'--k','LineWidth',2,'MarkerFaceColor','w')
hold on
% plot(d3(:,6),d3(:,2)/10,'-^k','LineWidth',2,'MarkerFaceColor','w')
set(gca,'xlim',[0 360],'xtick',[0:90:360],'FontSize',15)
set(gca,'ylim',[300 1100],'ytick',[300:100:1100],'FontSize',15)
set(gca,'YDir','reverse');
grid on
% legend('00','12','00')
ii=(i-1)/3+1;
s=strcat(num2str(date2(ii)),'风向')
title(s)
saveas(gcf,s,'png')
close(gcf)
% % ws
% figure
% plot(d1(:,7)/10,d1(:,2)/10,'-k','LineWidth',2,'MarkerFaceColor','w')
% hold on
% plot(d2(:,7)/10,d2(:,2)/10,'--k','LineWidth',2,'MarkerFaceColor','w')
% hold on
% % plot(d3(:,7)/10,d3(:,2)/10,'-^k','LineWidth',2,'MarkerFaceColor','w')
% set(gca,'xlim',[0 36],'xtick',[0:2:36],'FontSize',15)
% set(gca,'ylim',[300 1100],'ytick',[300:100:1100],'FontSize',15)
% set(gca,'YDir','reverse');
% grid on
% % legend('00','12','00','Location','NorthEast')
% ii=(i-1)/3+1;
% s=strcat(num2str(date2(ii)),'风速')
% title(s)
% saveas(gcf,s,'png')
% close(gcf)
end;
|
|