- Format your code.
- Give a description of what it does and what is wrong
- State clearly what you need it to do.
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
i want to plot the graph between the probability of false alarm and probability of detection
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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;
0 Kommentare
Antworten (1)
Matt Fig
am 15 Dez. 2012
2 Kommentare
Image Analyst
am 15 Dez. 2012
Bearbeitet: Image Analyst
am 15 Dez. 2012
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?
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!