holdon怎么写

1. hold on的美术字怎么写【holdon怎么写】 clear all; n=20; a=(round(100*rand(n,1))/100)*2.2-0.9; figure; %hold on; subplot(2,2,1); plot(1:n,a,'rx'); xlabel('样本数'); ylabel('生化化验值'); title('样本数据:生化化验值'); hold on; pause; %%先验概率 P=[0.9 0.1]; %%作类条件概率曲线p(x/wi) x=-0.9:0.01:1.3; px(1,:)=(1/(sqrt(2*pi)*0.3))*exp(-0.5*(x/0.3).^2); px(2,:)=(1/(sqrt(2*pi)*0.18))*exp(-0.5*((x-1)/0.1).^2); %figure; %hold on; subplot(2,2,2); plot(x,px(1,:),'b',x,px(2,:),'r--'); xlabel('生化化验值'); ylabel('概率密度'); title('类条件概率密度曲线'); axis tight; hold on; pause; %%做后验概率曲线 for i=1:2 pwx(i,:)=px(i,:)*P(i)./(px(1,:)*P(1)+px(2,:)*P(2)); end %figure(3); %hold on; subplot(2,2,3); plot(x,pwx(1,:),'b',x,pwx(2,:),'r--'); xlabel('生化化验值') ylabel('后验概率') title('后验概率曲线'); axis tight; hold on; pause %损失函数 r=[0, 1000, 000; 200, 000, 0]; %作条件风险曲线 for i=1:2 R(i,:)=r(i,1)*pwx(1,:)+r(i,2)*pwx(2,:); end %figure; %hold on; subplot(2,2,4); plot(x,R(1,:),'b',x,R(2,:),'r--'); xlabel('生化化验值'); ylabel('条件风险'); title('条件风险曲线') axis tight; hold off; pause %%计算给定检验值的类条件概率密度 for j=1:n s=a(j); PXW1=spline(x,px(1,:),s); PXW2=spline(x,px(2,:),s); PXW=[PXW1,PXW2]; disp('样本'); s %%计算后验概率?判别输出 for i=1:2 Pwx(i)=PXW(i)*P(i)/(PXW(1)*P(1)+PXW(2)*P(2)); end %计算条件风险,判别输出 for i=1:2 Rx(i)=r(i,1)*Pwx(1)+r(i,2)*Pwx(2); end disp('条件风险R(ai|x)=') Rx plot(x,R(1,:),'b',x,R(2,:),'r--'); xlabel('生化化验值'); ylabel('条件风险'); title('条件风险曲线') hold on plot(s,Rx(1),'or',s,Rx(2),'ob'); axis tight; hold off if Rx(1) 。

holdon怎么写

文章插图