MATLAB 绘制次模函数在不同约束条件下次模率图像
Posted slandarer
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MATLAB 绘制次模函数在不同约束条件下次模率图像相关的知识,希望对你有一定的参考价值。
本文只展示如何将该图像进行更加高质量的绘制,并不打算展示次模函数各个约束条件下求得解对比于最优解的比值保证的推演过程,以下是绘图效果
绘图效果:
绘图及修饰完整代码:
AG_Fcn=@(r,a)(1-exp(-a.*r))./a;
[gamma,alpha]=meshgrid([1e-6,0.05:0.05:1]);
mesh(gamma,alpha,AG_Fcn(gamma,alpha),'FaceColor','interp','EdgeColor',[0 0 0])
hold on
t=[1e-6,0.01:0.01:1];
plot3(t,ones(length(t)).*0,AG_Fcn(t,1e-6),'Color',[0.4660 0.6740 0.1880],'LineWidth',3)
plot3(t,ones(length(t)).*1,AG_Fcn(t,1),'Color',[0 0 0],'LineWidth',3)
plot3(ones(length(t)).*1,t,AG_Fcn(1,t),'Color',[1 0 0],'LineWidth',4)
ax=gca;
ax.XLim=[0 1];
ax.YLim=[0 1];
ax.ZLim=[0 1];
ax.XTick=0:0.5:1;
ax.YTick=0:0.5:1;
ax.ZTick=0:0.5:1;
ax.XTickMode='manual';
ax.YTickMode='manual';
ax.ZTickMode='manual';
ax.XTickLabel={'0','0.5','1'};
ax.YTickLabel={'0','0.5','1'};
ax.ZTickLabel={'0','0.5','1'};
ax.XTickLabelMode='manual';
ax.YTickLabelMode='manual';
ax.ZTickLabelMode='manual';
ax.XMinorTick='on';
ax.YMinorTick='on';
ax.ZMinorTick='on';
ax.XAxis.MinorTickValues=0:0.05:1;
ax.YAxis.MinorTickValues=0:0.1:1;
ax.ZAxis.MinorTickValues=0:0.1:1;
ax.XMinorGrid='on';
ax.YMinorGrid='on';
ax.ZMinorGrid='on';
ax.MinorGridLineStyle='-';
ax.YLabel.String='\\alpha';
ax.YLabel.Position=[0 0.45 -0.1];
ax.YLabel.FontSize=18;
ax.XLabel.String='\\gamma';
ax.XLabel.Position=[0.45 0.15 -0.1];
ax.XLabel.FontSize=18;
ax.ZLabel.String='approw.guarantee';
ax.ZLabel.Position=[0.2 1.45 0.25];
ax.ZLabel.FontName='Calibri';
ax.ZLabel.FontSize=18;
ta1=annotation('textarrow');
ta1.Color=[0.4660 0.6740 0.1880];
ta1.LineWidth=1;
ta1.X=[0.92 0.91];
ta1.Y=[0.67 0.72];
ta1.String='modular';
ta1.Interpreter='latex';
ta1.TextColor=[0 0 0];
ta1.FontSize=12;
ta2=annotation('textarrow');
ta2.Color=[0 0 0];
ta2.LineWidth=1;
ta2.X=[0.26 0.3];
ta2.Y=[0.6 0.54];
ta2.String='$1-e^{-\\gamma}$';
ta2.Interpreter='latex';
ta2.TextColor=[0 0 0];
ta2.FontSize=14;
ta3=annotation('textarrow');
ta3.Color=[1 0 0];
ta3.LineWidth=1;
ta3.X=[0.72 0.7];
ta3.Y=[0.78 0.74];
ta3.String='$\\alpha^{-1}(1-e^{-\\alpha})$';
ta3.Interpreter='latex';
ta3.TextColor=[0 0 0];
ta3.FontSize=14;
ta4=annotation('textarrow');
ta4.Color=[0 0 1];
ta4.LineWidth=1;
ta4.X=[0.544 0.565];
ta4.Y=[0.82 0.77];
ta4.String='classical$(1-e^{-1})$guarantee';
ta4.Interpreter='latex';
ta4.TextColor=[0 0 0];
ta4.FontSize=12;
以上是关于MATLAB 绘制次模函数在不同约束条件下次模率图像的主要内容,如果未能解决你的问题,请参考以下文章