MATLAB例程教学内容.doc
《MATLAB例程教学内容.doc》由会员分享,可在线阅读,更多相关《MATLAB例程教学内容.doc(24页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Good is good, but better carries it.精益求精,善益求善。MATLAB例程-MatlabResources:http:/www.people.cornell.edu/pages/jf262/matlab_main.htm1.MatlabatMathWorksFulldocumentationbythedeveloper2.MatLabTutorialhttp:/users.ece.gatech.edu/%7Ebonnie/book/TUTORIAL/tutorial.htmlThistutorialisavailableasasupplemen
2、ttothetextbookFundamentalsofSignalsandSystemsUsingMatlabbyEdwardKamenandBonnieHeck,publishedbyPrenticeHall.Alsoavailableaspdf.http:/www.people.cornell.edu/pages/jf262/matlab/useful%20pages/tutorial.pdf3.MatLabgraphicshttp:/www.people.cornell.edu/pages/jf262/matlab/useful%20pages/Matlab%20graphics.ht
3、mTomiSalminen,CSC1998.AnintroductiontoMatlabgraphicscommandswithexamplesandfigures.4.NumericalComputingwithMATLABhttp:/www.people.cornell.edu/pages/jf262/matlab/ebook1/ncm_index.htm5.MatLabvectorandmatrixtips(pdf)http:/www.people.cornell.edu/pages/jf262/matlab/useful%20pages/mtt.pdf6.MatlabProgramin
4、g:Design&Application(Chinese)http:/www.people.cornell.edu/pages/jf262/matlab/matlablearn/index.htm1、 figure1)h=bar(clrflux_up10(:,2),clrflux_up10(:,3),Edgecolor,k,Facecolor,k)holdonbar(pollutionflux_up10(:,2),pollutionflux_up10(:,3),Edgecolor,k,Facecolor,w)axis(400700015);boxoffxlabel(TOAflux(Wm-2)l
5、egend(AODleq0.2,AOD0.5)axis(400700015);set(gca,TickLength,0.015;0.015)set(gca,TickDir,out);set(gca,position,0.150.30.70.4)plot(DATEnum,BJ2005_MISR_AER(:,4),:ks,LineWidth,1,MarkerEdgeColor,m,MarkerFaceColor,m,MarkerSize,5)holdonplot(DATEnum,BJ2005_MISR_AER(:,8),:ko,LineWidth,1,MarkerEdgeColor,b,Marke
6、rFaceColor,b,MarkerSize,5)附加绘图程序:date=070427;station=bj;n=size(date,1);c=strcat(station,date);a=load(D:BJDOASbj2,c,.dat);figure(Position,1,1,800,800);plot(1:288,a(:,6),*-r,LineWidth,2.5);holdonplot(1:288,a(:,8),o-b,LineWidth,2.5);plot(1:288,a(:,10),-k,LineWidth,2.5);holdoffYLabel(fontsize16MixingRat
7、io(ppb);XLabel(fontsize16Hours);Title(fontsize14,date(1:2),/,date(3:4),/,date(5:6);Legend(fontsize14SO_2,fontsize14NO_2,fontsize14O_3);legend(boxoff);XLim(0.5,288.5);%YLim(0,max(a(:,6),a(:,8),a(:,10)*1.2);set(gca,xtick,0.5:24:288.5,xticklabel,0:2:24,fontsize,12);saveas(gcf,D:BJDOASbj5,c,.emf);close;
8、2)文本标注Ht=text(0,0,fontsize12alpha=0.3)set(ht,Color,k,HorizontalAlignment,Center)3)双坐标轴绘制I)粗略绘制set(gca,TickLength,0.015;0.015)set(gca,position,0.150.60.50.2);axis(0,4000,-15,20,0,100);AX,H1,H2=plotyy(upair2(1:7,3),upair2(1:7,4),upair2(1:7,3),upair2(1:7,6)set(H1,Color,k);%set(H1,XMinorTick,on);axes(Po
9、sition,get(AX(1),Position),XColor,k,YColor,k)set(H2,Color,k,LineStyle,:);title(10-02)II)精确绘制tp:压力变量tt:温度变量clfreset,h_ap=axes(position,0.13,0.13,0.7,0.75);set(h_ap,Xcolor,b,Ycolor,b,Xlim,0,5,Ylim,0,15);nx=10;ny=6;%为两套坐标系定义共同的坐标刻度分段数。pxtick=0:(5-0)/nx:5;pytick=0(15-0)/ny):15;set(h_ap,Xtick,pxtick,Ytic
10、k,pytick,Xgrid,on,Ygrid,on)%保证坐标系按约定分段数刻度;h_linet=line(tp,yp,Color,b);set(get(h_ap,Xlabel),String,时间rightarrow分)set(get(h_ap,Ylabel),String,压力rightarrow(times105pa))h_at=axes(position,get(h_ap,Position);%保证两套坐标系重合的技巧。set(h_at,Color,none,Xcolor,r,Ycolor,r);保证重合坐标系都可见的技术,使得后面产生的h_at轴背景“无色透明,而不遮盖前面的图像。
11、set(h_at,Xaxislocation,top)%把第二套坐标系的横轴设置在轴位框的“顶边”,把纵轴设置在轴位的“右%边”,而且增值%的方向是自上而下的set(h_at,Yaxislocation,right,Ydir,rev)set(get(h_at,Xlabel),String,时间rightarrow分)set(get(h_at,Ylabel),String,压力rightarrow(times105pa))set(h_at,Ylim,0,210)line(tt,yt,Color,r,Parent,h_at);%确保温度曲线绘制在h_at坐标中xpm=get(h_at,Xlim);
12、%获取h_at坐标系横轴的取值范围。txtick=xpm(1):(xpm(2)-xpm(1)/nx):xpm(2);tytick=0:(210-0)/ny):210;set(h_ap,Xtick,txtick,Ytick,tytick)4)绘制多个图形,在一张图上ff=figure(ss)h1=subplot(3,1,1)plot(modis_spr(:,1),modis_spr(:,3),g-)xlim(2000.52006.5)ylim(01.5)holdonplot(modis_sum(:,1),modis_sum(:,3),r-o)holdonplot(modis_aut(:,1),m
13、odis_aut(:,3),y-)holdonplot(modis_win(:,1),modis_win(:,3),b-*)legend(MAM,JJA,SON,DJF,Orientation,horizontal)legend(boxoff)%legend()title(ZHANDIANss,:)set(h1,position,0.1,0.65,0.6,0.2)set(gca,ytick,0:0.5:1.5,yticklabel,0.0;0.5;1.0;1.5,xticklabel,fontsize,10)ylabel(AODat550nm)set(gca,yminortick,on);se
14、t(gca,TickLength,0.02;0.02);h2=subplot(3,1,2)plot(spr(:,1),spr(:,4),g-)xlim(2000.52006.5)holdonplot(sum(:,1),sum(:,4),r-o)holdonplot(aut(:,1),aut(:,4),y-)holdonplot(win(:,1),win(:,4),b-*)%set(gca,yticklabel,0.00.10.30.4,xticklabel,)set(h2,position,0.1,0.45,0.6,0.2,fontsize,10)set(gca,xticklabel,)set
15、(gca,yminortick,on);set(gca,TickLength,0.02;0.02);set(gca,TickLength,0.02;0.02,YAxisLocation,right);ax=axes(Position,get(gca,Position),.YAxisLocation,left,.Color,none,xlim,get(gca,xlim),.ylim,get(gca,ylim),yticklabel,);ylabel(PM10,);%写成两行set(gca,yminortick,on,fontsize,10);set(gca,TickLength,0.02;0.0
16、2);h3=subplot(3,1,3)plot(spr(:,1),spr(:,3),g-)xlim(2000.52006.5)ylim(0200)holdonplot(sum(:,1),sum(:,3),r-o)holdonplot(aut(:,1),aut(:,3),y-)holdonplot(win(:,1),win(:,3),b-*)set(h3,position,0.1,0.25,0.6,0.2)set(gca,xticklabel,2001:1:2006,fontsize,10)set(gca,TickLength,0.01;0.01);xlabel(year)ylabel(API
17、)set(gca,yminortick,on,fontsize,10);set(gca,TickLength,0.02;0.02);%saveas(ff,E:resultseason_figure,sitess,:,season_modis.emf);%saveas(ff,E:resultseason_figure,sitess,:,season_modis.eps);2、相关系数计算rs=corrcoef(x,y)3、气溶胶插值程序wt=log(0.44/0.47)/log(0.659/0.47)taer44=raddata(ii,20)*(raddata(ii,19)/raddata(ii
18、,20)*wt4、%计算大气层顶向上和地面向下辐射通量的反射率fori=1:xh_num%solardistance:日地距离xxx=2*3.1416*(xh_total(i,5)-1)/365;solardistance(i)=1.000109+0.033494*cos(xxx)+0.001472*sin(xxx)+0.000768*cos(2*xxx)+0.000079*sin(2*xxx);%计算日地距离的比值albupflux(i)=xh_total(i,18)/(solardistance(i)*solardistance(i)*xh_total(i,25)*1366);%计算大气层
19、顶的反照率albdownflux(i)=xh_total(i,22)/(solardistance(i)*solardistance(i)*xh_total(i,25)*1366);%计算透过End6、插值程序loadE:ceresskytoaoutputHuabeitotalflux1002.dat;datafile=totalflux1002toa_new=zeros(81,81);lat=zeros(81,81);lon=zeros(81,81);forn=1:81lat(1:81,n)=42:-0.05:38;lon(n,1:81)=115:0.05:119;endZI=zeros(8
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- MATLAB 例程 教学内容
限制150内