bayes.m
close all
y=[1 1];
z=1;
len=1000;
p0=0.5;
pfa=[];
CLUSTER1=[];
CLUSTER2=[];
CLUSTER3=[];
CLUSTER4=[];
for j=1:1:1000
x=[rand rand];
[datatx,datarx,datadetected,bayesruleselected,pl,ph,val_pl,val_ph,...
pd,gamma,pd_obtained,pfa_obtained]...
=binarychanneldetection(x,y,z,len,p0,pfa)
v=bayesruleselected;
if(v==1)
CLUSTER1=[CLUSTER1;x];
elseif(v==2)
CLUSTER2=[CLUSTER2;x];
elseif(v==3)
CLUSTER3=[CLUSTER3;x];
else
CLUSTER4=[CLUSTER4;x];