资源描述:
《Matlab常用的绘图程序.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、下面是一些绘图的源程序,来自Matlab自带的help文件程序1figuret=0:pi/20:2*pi;plot(t,sin(t),'-.r*')holdonplot(t,sin(t-pi/2),'--mo')plot(t,sin(t-pi),':bs')holdoff;title('sin(t),sin(t-pi/2),sin(t-pi)')程序2figureplot(t,sin(2*t),'-mo',...'LineWidth',2,...'MarkerEdgeColor','k',...'Mark
2、erFaceColor',[.491.63],...'MarkerSize',10)程序3loadclownsurface(peaks,flipud(X),...'FaceColor','texturemap',...'EdgeColor','none',...'CDataMapping','direct')colormap(map)view(-35,45)程序4pcolor(hadamard(20))colormap(gray(2))axisijaxissquare程序5n=6;r=(0:n)'/n;t
3、heta=pi*(-n:n)/n;X=r*cos(theta);Y=r*sin(theta);C=r*cos(2*theta);pcolor(X,Y,C)axisequaltight程序6loadmandrillfigure('color','k')image(X)colormap(map)axisoff%Removeaxisticksandnumbersaxisimage%Setaspectratiotoobtainsquarepixels程序7figureax(1)=subplot(1,2,1);rg
4、b=imread('ngc6543a.jpg');image(rgb);title('RGBimage')ax(2)=subplot(1,2,2);im=mean(rgb,3);image(im);title('IntensityHeatMap')colormap(hot(256))linkaxes(ax,'xy')程序8loadflujetimage(X)colormap(jet)程序9loadspineimage(X)colormapbone程序10figurex=0:pi/20:2*pi;y1=si
5、n(x+1).*cos(x-1);y2=sin(x+1).^2+cos(x-1);y3=sin(2*x+1)+cos(x/2-1);plot(t,y1,'-.b*')holdonplot(t,y2,'--ro')plot(t,y3,':gs')holdoff