matlab 用subplot和hold on 以后是这个效果,试验程序运行出来是个效果: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('生化化验

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/28 10:19:06
matlab 用subplot和hold on 以后是这个效果,试验程序运行出来是个效果: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('生化化验

matlab 用subplot和hold on 以后是这个效果,试验程序运行出来是个效果: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('生化化验
matlab 用subplot和hold on 以后是这个效果,
试验程序运行出来是个效果:

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 on;
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)<Rx(2)
w(j,1)=s;
disp('正常人')
else
w(j,2)=s;
disp('感染病人')
end
pause;
end
disp('')
disp('正常人 感染病人 ')
w

matlab 用subplot和hold on 以后是这个效果,试验程序运行出来是个效果: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('生化化验
除了第一个subplot前面的figure留着,后面的figure语句都去掉,否则没画一个内容,都新开一个窗口.

matlab 用subplot和hold on 以后是这个效果,试验程序运行出来是个效果: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('生化化验 matlab 用subplot和hold on 以后无法把绘图放在一个窗口里,试验程序运行出来是个效果: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('样本数');ylabe matlab里面的“subplot”和“ezplot”,“grid matlab 消除subplot的边界 matlab 中subplot(221)是什么意思? matlab中subplot(211)是什么意思? matlab做FFT频谱分析的问题t=0:0.1:10y=exp(-t)subplot(311)stem(t,y);grid onz=fft(y)subplot(312)stem(t,abs(z)/10);hold on;x=sqrt(1+t.*t)a=1./xsubplot(312)stem(t,a)hold onsubplot(313)stem(t,angle(z))第二个图像时FFT的图像和理论值得 如何打开matlab中一个结果图的子图?用subplot(2,1,1)和subplot(2,1,2)画了一幅图,怎样能把他们分开就是怎样单独一个窗口显示subplot(2,1,1)的图?急等啊……,没分了 但还望高人指教啊 在Matlab中怎么用subplot在同一位置绘制双Y轴坐标的图 matlab里figure(1),subplot(121) matlab subplot问题现有 var1,var2 ,var3,都是导入的的数据,现在想用subplot将他们3个的波形画在一行,subplot(3,1,1),subplot(3,1,2),subplot(3,1,3)(好像是这样的.但请问怎么把数据加入呢.),求完整的命令,注意是 MATLAB中的指令subplot(m,n,p),m和n分别代表什么?麻烦讲具体点! matlab高手帮我看看程序错哪里吧x=-6:0.012:6;y=-4:0.008:4;z1=(sin(sqrt(x.^2+y.^2)))./sqrt(x.^2+y.^2);subplot(2,2,1);surfc(x,y,z1)hold;z2=100*(y-x.^2).^2+(1-x).^2;subplot(2,2,2);surfc(x,y,z2)hold;z3=arcos(x.^4+sin(y));subplot(2,2,3);surfc(x, 怎么用matlab画高斯窗函数?比如 n=50;window=hanning(n);[h,w]=freqz(window,1);subplot(1,2,1)stem(window);subplot(1,2,2);plot(w/pi,20*log(abs(h)/abs(h(1))));可以生成汉宁窗函数和频谱函数,类似的怎么生成高斯窗函数的? 我想问问我用matlab生成抽样信号的时域和频域波形图.可是幅度谱出不来这里是我写的程序:t3=-20:0.001:20;x3=sinc(t3/pi);x31=fft(x3);figure(1);subplot(2,2,1),plot(t3,x3),title('Sampling signal');grid on;subplot(2,2,2),p 帮忙做一下MATLAB做题不会让亲白辛苦的.t=-pi:pi/200:8*pi; h=figure(1) set(h,'color',[1 1 1])subplot(1,2,1),plot3(cos(t)sin(t),t,'b-')subplot(1,2,2),comet3(sin(t),cos(t),t) 接下来是要连一条线,让起点和终点用一条线连在 matlab中 hold subplot(1,2,1)和subplot(1,2,