Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

i want to plot the graph between the probability of false alarm and probability of detection

조회 수: 1 (최근 30일)
clear; L=3; a=1; N=1000; Ns=3; f1=0.05; v=0.2985; %db2mag gi=1; gl=1; gj=1; w=0; sigm=0; for i=1:L sigma(i)=0.5*(gi)^2; sigm=sigm+sigma(i); end; for n=1:L rs(n)=sigm^2*(Ns-n)/Ns; pl(n)=rs(n); pc(n)=rs(n).*cos(2*pi*f1*n); end ps=0; for l=1:L p(l)=gl*pl(l)*cos(w*l); ps=ps+p(l); end
q=0; for i=1:L for j=1:L if j>i; break
q1(i,j)=0.5*gi*(pc(i-j)+pc(i+j))*gj;
q=q+q1(i,j);
end
end
end %p0=qfunc*(y.*(((y.^2)+sigma)/n).^(-0.5));
for e=1:1:10
y(e)=(qfuncinv(e)).*sqrt((0.5*a)./(N-((qfuncinv(e)).^2))); %lamda
z(e)=(((1+v)*y(e).^2)-(4*ps*v*y(e))+(sigma+q*v))/(N*(v+1)^2);
u1=ps*v/(v+1);
p1(e)=qfunc((y(e)-u1)/sqrt(z(e)^2*(y(e))));
end
plot(p0,p1,'b*'); grid;

답변 (1개)

Matt Fig
Matt Fig 2012년 12월 15일
  1. Format your code.
  2. Give a description of what it does and what is wrong
  3. State clearly what you need it to do.
  댓글 수: 2
ahmed
ahmed 2012년 12월 15일
this is m file matlab program and this is the code which i do it and this is amistake in line 46 this code for plot graph between probability of false alarm and probability of detection in cognative radio
Image Analyst
Image Analyst 2012년 12월 15일
편집: Image Analyst 2012년 12월 15일
But why won't you tell us what the error is???? When I copied and pasted your code into a blank m-file, line 47 was a blank line so I can't even guess what the error is, and I can't even run it because you forgot to list what toolbox was required - the one that has function qfuncinv - so I wasted my time even trying to find out what the error was. Why do you make it hard on us to help you?

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by