-
Notifications
You must be signed in to change notification settings - Fork 1
/
cond.m
46 lines (32 loc) · 1.04 KB
/
cond.m
1
function g = cond(R,alpha,N1,I1,pulses,A,disp_n,variance,bins)inter="yes"if(sum(I1)==0) inter="no"endout=figuresubplot(1,2,1)pdf_A1=conditional_pdf(R,pulses,A);[f,x]=hist(pdf_A1,bins);bar(x, f / sum(f));title(['PDF of R given that S=A; E[R|S=A]= ',num2str(mean(pdf_A1))]);hold on;line([0, 0], ylim, 'LineWidth', 2, 'Color', 'r');subplot(1,2,2)pdf_A2=conditional_pdf(R,pulses,-A);[f,x]=hist(pdf_A2,bins);bar(x, f / sum(f));title(['PDF of R given that S=-A ; E[R|S=-A]= ',num2str(mean(pdf_A2))]);hold on;line([0, 0], ylim, 'LineWidth', 2, 'Color', 'r');%name=strcat("CPDF_A=",num2str(A),"_Var=",num2str(variance),"_alpha=",num2str(alpha),"_Interference=",inter,".eps")%print (out,name, "-depsc")name=strcat("PDF_A=",num2str(A),"_Var=",num2str(variance),"_alpha=",num2str(alpha),"_Interference=",inter,".eps")out2=figure[f,x]=hist(R,bins);bar(x, f / sum(f));title(['PDF of R; E[R]= ',num2str(mean(R))]);axis([-6 6 0 inf])hold on;line([-4, -4], ylim, 'LineWidth', 2, 'Color', 'r');print (out2,name, "-depsc","-F:8")end