数学建模常用的Matlab绘图总结.doc_第1页
数学建模常用的Matlab绘图总结.doc_第2页
数学建模常用的Matlab绘图总结.doc_第3页
数学建模常用的Matlab绘图总结.doc_第4页
数学建模常用的Matlab绘图总结.doc_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

饼状图Expenses = 20 10 40 12 20 19 5 15; ExpenseCategories = Food,Medical,Lodging,Incidentals,. Transport,Utilities,Gifts,Shopping; MostLeastExpensive = (Expenses=max(Expenses)|Expenses=min(Expenses); h=pie(gca,Expenses,MostLeastExpensive,ExpenseCategories); Expenses = 20 10 40 12 20 19 5 15; MostLeastExpensive = (Expenses=max(Expenses)|Expenses=min(Expenses); h=pie(gca,Expenses,MostLeastExpensive); legend(Food,Medical,Lodging,Incidentals,. Transport,Utilities,Gifts,Shopping); Expenses = 20 10 40 12 20 19 5 15; MostLeastExpensive = 0 1 0 1 0 1 0 1;%分割h=pie(gca,Expenses,MostLeastExpensive); legend(Food,Medical,Lodging,Incidentals,. Transport,Utilities,Gifts,Shopping); x = 20 10 40 12 20 19 5 15;explode = 4 2 2 2 2 4 2 2;label = Food,Medical,Lodging,Incidentals,. Transport,Utilities,Gifts,Shopping,;figure(color,w,renderer,openGL);h = pie3(x,explode);h = findobj(h,Type,text);set(h,string,cellfun(strcat,get(h,string),label,un,0),FontName,Times New Roman,FontSize,16);%set(h,string,strcat(get(h,string),label);%cm = 72 65 137;143 184 58;193 60 49;41 121 201;. % 60 65 150;189 84 58;193 160 90;241 121 101/255;colormap(jet), shading interpview(18,20), camproj perspectivelight(Position,1 2 3,Style,inf)lighting gouraudx = 20 10 40 12 20 19 5 15;explode = 4 2 2 2 2 4 2 2;label = 14% Food,7% Medical,28% Lodging,9% Incidentals,. 14% Transport,13% Utilities,4% Gifts,11% Shopping,;figure(color,w,renderer,openGL);pie3s(x,Explode,explode,Labels,label)%见Matlab_pie3s直方图Y = round(rand(5,3)*10);figure;subplot(2,2,1); bar(Y,grouped); title(Group)subplot(2,2,2); bar(Y,stacked); title(Stack)subplot(2,2,3); bar(Y,histc); title(Histc)subplot(2,2,4); bar(Y,hist); title(Hist)stream = RandStream(mrg32k3a,Seed,4);y1 = rand(stream,10,5);hb = bar(y1,stacked); colormap(summer); hold ony2 = rand(stream,10,1);set(gca,FontSize,14,FontName,Times New Roman)hp = plot(1:10,y2,marker,square,markersize,12,. markeredgecolor,y,markerfacecolor,.6,0,.6,. linestyle,-,color,r,linewidth,2); hold offlegend(hb,hp,Carrots,Peas,Peppers,Green Beans,. Cucumbers,Eggplant,Location,SouthEastOutside)Data = 1,-2,3,1,-1,-2 4 2 3;DataP = Data;DataN = Data;DataP(Data 0) = 0;figure;bar(DataP,0.5,k,EdgeColor,k);hold on;bar(DataN,0.5,b,EdgeColor,b);Y = round(rand(5,3)*10);figure;subplot(2,2,1); bar3(Y,grouped); title(Group,FontSize,14,FontName,Times New Roman)subplot(2,2,2); bar3(Y,stacked); title(Stack,FontSize,14,FontName,Times New Roman)subplot(2,2,3); bar3(Y,histc); title(Histc,FontSize,14,FontName,Times New Roman)subplot(2,2,4); bar3(Y,hist); title(Hist,FontSize,14,FontName,Times New Roman)杆状图Data = 1,-2,3,1,-1,-2 4 2 3;DataP = Data;DataN = Data;DataP(Data 0) = NaN;figure;stem(DataP,k);hold on;stem(DataN,b);Data = 1,-2,3,1,-1,-2 4 2 3;DataP = Data;DataN = Data;DataP(Data 0) = NaN;figure;stem(DataP,k,fill);hold on;stem(DataN,b,fill);Data = 1,-2,3,1,-1,-2 4 2 3;DataP = Data;DataN = Data;DataP(Data 0) = NaN;figure;stem(DataP,:diamondk,fill);hold on;stem(DataN,:diamondr,fill);Data = 1,-2,3,1,-1,-2 4 2 3;DataP = Data;DataN = Data;DataP(Data 0) = NaN;figure;stem(DataP,LineStyle,-.,MarkerFaceColor,k,MarkerEdgeColor,green);hold on;stem(DataN,LineStyle,-.,MarkerFaceColor,red,MarkerEdgeColor,green);三维图形figure;X,Y = meshgrid(-15:.5:15,-12:.5:12);%X belongs to -15,15 and Y belongs to -12,12.R = sqrt(X.2 + Y.2) + eps;Z = sin(R)./R;mesh(Z); %surf(X,Y,Z)xlabel(X,FontSize,14,FontName,Times New Roman)ylabel(Y,FontSize,14,FontName,Times New Roman)zlabel(Z,FontSize,14,FontName,Times New Roman)title(3-D space,FontSize,16,FontName,Times New Roman)figure;X=-12:0.5:12;Y=-12:0.5:12;%surf绘图时,X,Y可以是一维向量,也可以是二维矩阵R=ones(length(X),length(Y);for i=1:length(X) for j=1:length(Y) R(i,j) = sqrt(X(i).2 + Y(j).2) +eps; endendZ = sin(R)./R;surf(X,Y,Z);xlabel(X,FontSize,14,FontName,Times New Roman)ylabel(Y,FontSize,14,FontName,Times New Roman)zlabel(Z,FontSize,14,FontName,Times New Roman)title(3-D space by surf,FontSize,16,FontName,Times New Roman)figure;X,Y = meshgrid(-15:.5:15,-12:.5:12);%X belongs to -15,15 and Y belongs to -12,12.R = sqrt(X.2 + Y.2) + eps;Z = sin(R)./R;plot3(X,Y,Z);xlabel(X,FontSize,14,FontName,Times New Roman)ylabel(Y,FontSize,14,FontName,Times New Roman)zlabel(Z,FontSize,14,FontName,Times New Roman)title(3-D space by plot3,FontSize,16,FontName,Times New Roman)数学公式、符号和希腊字母的输入命令Character SequenceSymbolCharacter SequenceSymbolCharacter SequenceSymbolalphaupsilonsimbetaphileqgammachiinftydeltapsiclubsuitepsilonomegadiamondsuitzetaGammaheartsuitetaDeltaspadesuitthetaThetaleftrightarrowvarthetaLambdaleftarrowiotaXiuparrowkappaPirightarrowlambdaSigmadownarrowmuUpsiloncircnuPhipmxiPsigeqpiOmegaproptorhoforallpartialsigmaexistsbulletvarsigmanidivtaucongneqequivapproxalephIm Rewpotimesoplusoslashcapcup supseteqsupset subseteqsubsetintinorfloorlceilnablalfloorcdotldots.perp negprimewedge timesx0 rceilsurdmid|veevarpicopyrightlanglerangle图形标注set(gca,FontSize,10, FontName,Arial)xlabel(test,FontSize,10,FontName,Arial)ylabel(test,FontSize,10,FontName,Arial)legend(test,FontSize,10,FontName,Arial)title(test,FontSize,13,FontName,Times New Rom

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论