MATLAB天气查看

转自     http://www.matlabsky.com/thread-21908-1-1.html


%matlab天气查看器
%天气数据来源:http://www.weather.com.cn/
%
% copyright?2008-2011 baby_wolf
%          $10-Dec-2011 02:11:15$

clear all
close all
cityid='101020500'; %更改此处的cityid  %闵行:101020200  嘉定:101020500
if ~exist('myweather.html','file')
fid=fopen('myweather.html','w');
str='<html>\r\n<body>\r\n<table>\r\n<tr>\r\n<td>\r\n <div align="center">';
fprintf(fid,str);
str=['<iframe src="http://m.weather.com.cn/m/pn11/weather.htm?id=',cityid,'T" ',...
'width="490" height="50" marginwidth="0" marginheight="0" hspace="0" ',...
'vspace="0" frameborder="0" scrolling="no">\r\n</iframe>\r\n</div>\r\n<div>\r\n'];
fprintf(fid,str);
%% 实况温度模块
str=['<IFRAME name=surf src="http://flash.weather.com.cn/sk2/shikuang.swf?',...
'id=',cityid,'" frameBorder=0 width=625 scrolling=no height=240>\r\n</IFRAME>\r\n</div>'];
fprintf(fid,str);
%% 全国天气模块
str=['<iframe src="http://flash.weather.com.cn/wmaps/index.swf?url1=http%%3A%%2F%%',...
'2Fwww%%2Eweather%%2Ecom%%2Ecn%%2Fweather%%2F&url2=%%2Eshtml&from=cn" width="625" ',...
'height="457" marginwidth="0" marginheight="0" hspace="0" vspace="0" ',...
'frameborder="0" scrolling="no">\r\n</iframe>\r\n</td>\r\n<td halign="center" valign="top"> '];
fprintf(fid,str);
%-------------------微博模块------------------------------------------
% str=['\r\n<div>\r\n<iframe width="300" height="550" class="share_self"  frameborder="0" '...
% 'scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?',...
% 'language=&width=0&height=550&fansRow=2&ptype=1&speed=0&skin=1&isTitle=1&nobo',...
% 'rder=1&isWeibo=1&isFans=1&uid=2152932322&verifier=13d43368&dpc=1">\r\n</iframe>\r\n</div>\r\n'];
% fprintf(fid,str);
%-------------------------------------------------------------

str='</td>\r\n</tr>\r\n</table>\r\n</body>\r\n</html>';
fprintf(fid,str);
fclose(fid);
end   %end if exist('myweather.html','file');
pause(.1);
figure('numbertitle','off','menu','none','name','matlab天气查看器','pos',[100 100 700 600]);
myweb=actxcontrol('Shell.Explorer.2',[0 0 700  600]);
myweb.Navigate([pwd '/myweather.html']);



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值