第一篇:數學建模常用的Matlab繪圖總結
餅狀圖
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);
ShoppingGiftsFoodMedicalUtilitiesTransportLodgingIncidentalsExpenses = [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');
4%FoodMedicalLodgingIncidentalsTransportUtilitiesGiftsShopping
14%11%7%13%14%28% 9% 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');
11%14%4%7%13% FoodMedicalLodgingIncidentalsTransportUtilitiesGiftsShopping28%14% 9%
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;...%
150;189 84 58;193 160 90;241 121 101]/255;colormap(jet), shading interp view(18,20), camproj perspective light('Position',[1 2 3],'Style','inf')lighting gouraud
x = [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')Group105100123Histc10501050450123Hist453020Stack1234512345
stream = RandStream('mrg32k3a','Seed',4);y1 = rand(stream,10,5);hb = bar(y1,'stacked');colormap(summer);hold on y2 = 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 off legend([hb,hp],'Carrots','Peas','Peppers','Green Beans',...'Cucumbers','Eggplant','Location','SouthEastOutside')3.532.521.510.50 12345678910CarrotsPeasPeppersGreen BeansCucumbersEggplant Data = [1,-2,3,1,-1,-2 4 2 3];DataP = Data;DataN = Data;DataP(Data < 0)= 0;DataN(Data > 0)= 0;figure;bar(DataP,0.5,'k','EdgeColor','k');hold on;bar(DataN,0.5,'b','EdgeColor','b');43210-1-2123456789
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')
Group1020Stack***Histc1010Hist***45123
桿狀圖
Data = [1,-2,3,1,-1,-2 4 2 3];DataP = Data;DataN = Data;DataP(Data < 0)= NaN;DataN(Data > 0)= NaN;figure;stem(DataP,'k');hold on;stem(DataN,'b');43210-1-2123456789Data = [1,-2,3,1,-1,-2 4 2 3];DataP = Data;DataN = Data;DataP(Data < 0)= NaN;DataN(Data > 0)= NaN;figure;stem(DataP,'k','fill');hold on;stem(DataN,'b','fill');4
3210-1-2123456789 Data = [1,-2,3,1,-1,-2 4 2 3];DataP = Data;DataN = Data;DataP(Data < 0)= NaN;DataN(Data > 0)= NaN;figure;stem(DataP,':diamondk','fill');hold on;stem(DataN,':diamondr','fill');43210-1-2123456789
Data = [1,-2,3,1,-1,-2 4 2 3];DataP = Data;DataN = Data;DataP(Data < 0)= NaN;DataN(Data > 0)= NaN;figure;stem(DataP,'LineStyle','-.','MarkerFaceColor','k','MarkerEdgeColor','green');hold on;stem(DataN,'LineStyle','-.','MarkerFaceColor','red','MarkerEdgeColor','green');4
3210-1-2123456789
三維圖形
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')
3-D space by mesh10.5Z0-0.***203040506070YX
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;
end end
Z = 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')
3-D space by surf10.5Z0-0.5151050-5-10-15-15-10-5051015YX
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')
3-D space by plot310.5Z0-0.5151050-5-10-5051015Y-15-15-10X
數學公式、符號和希臘字母的輸入命令
Character Sequence alpha beta gamma delta epsilon zeta eta theta vartheta iota kappa lambda mu nu xi pi rho sigma varsigma tau equiv Im otimes cap supset int rfloor lfloor perp wedge rceil vee langle Symbol α β γ δ ? δ ε Θ ? ι κ λ μ ν ξ π π σ ρ τ ≡ ?
? ∩ ?
∫ ? ? ⊥
∧
ù ∨ ∠
Character Sequence upsilon phi chi psi omega Gamma Delta Theta Lambda Xi Pi Sigma Upsilon Phi Psi Omega forall exists ni cong approx Re oplus cup
subseteq in lceil cdot neg times surd varpi rangle
Symbol ? Φ σ τ υ Γ Δ Θ Λ Ξ Π Σ ? Φ Ψ Ω ? ? ? ? ≈ ? ⊕ ∪
? ∈ é · ? x √ ? ∠ Character Sequence sim leq infty clubsuit diamondsuit heartsuit spadesuit leftrightarrow leftarrow uparrow rightarrow downarrow circ pm geq propto partial bullet div neq aleph wp oslash supseteq subset o nabla ldots prime 主站蜘蛛池模板: 蜜臀性色av免费| 欧美 变态 另类 人妖| 久久久精品久久日韩一区综合| 亚洲gv永久无码天堂网| 国产成人无码免费视频在线| 亚洲精品久久午夜无码一区二区| 最好看的最新高清中文视频| 久久精品国产亚洲av大全| 欧美巨大黑人极品精男| 午夜福利在线永久视频| 永久免费不卡在线观看黄网站| 国产999精品2卡3卡4卡| 国精产品推荐视频| 少妇扒开粉嫩小泬视频| 风韵丰满熟妇啪啪区老老熟女百度| 亚洲av永久无码精品网址| 亚洲av永久无码国产精品久久| 在线a毛片免费视频观看| 国产女高清在线看免费观看| 免费精品99久久国产综合精品| 久久婷婷五月综合97色直播| 女人天堂一区二区三区| 亚洲精品v欧洲精品v日韩精品| 狠狠噜天天噜日日噜无码| 中文字幕乱码人妻综合二区三区| 国产婷婷色综合av蜜臀av| 国产午夜福利片1000无码| 亚洲中文字幕无码一久久区| 波多野av一区二区无码| 精品视频一区二区三区在线观看| 亚洲一区波多野结衣在线app| 日韩视频无码中字免费观| 国产精品亚韩精品无码a在线| 国产成人无码精品久久久性色| 日本无码v视频一区二区| 2020精品国产福利在线观看香蕉| 亚洲精品无码永久在线观看你懂的| 国产精品_九九99久久精品| 又粗又猛又黄又爽无遮挡| 成人精品一区二区三区电影免费| 国产永久免费高清在线观看|