我有这个:
leg2=strcat('Max Degree :',num2str(adet(1,1)/ch(l)));
leg3=strcat('Min Degree :',num2str(adet(1,2)/ch(l)));
leg4=strcat('Max Request :',num2str(adet(1,3)/ch(l)));
leg5=strcat('Min Request :',num2str(adet(1,4)/ch(l)));
leg6=strcat('Max Priority :',num2str(adet(1,5)/ch(l)));
leg7=strcat('Random :',num2str(adet(1,6)/ch(l)));
leg8=strcat('AICS :',num2str(adet(1,7)/ch(l)));
legend(leg2,leg3,leg4,leg5,leg6,leg7,leg8,'Location','SouthWest');
Here, adet(1,1)/ch(l)
是 0 到 1 之间的数字。有时它会变成类似0.01666667
。我想为其设置一个精度,使其类似于“0.02”。
我可以用disp()
函数与format bank
。但我不知道如何将其应用到情节中。抱歉英语不好。