for j=1:length(gamasr_dB)
gamasr(j)=10.^(gamasr_dB(j)/10);
alfa(j)=sqrt((gpsk.*gamasr(j)/m)/(1+(gpsk.*gamasr(j)/m)))*cot(pi/M);
K(j)=(1/pi)*sqrt((gpsk.*gamasr(j)/m)/(1+gpsk.*gamasr(j)/m));
suma2=0;
for k=1:(m-1)
for i=1:k
T(i)=(factorial(2*k)/(factorial(k)^2))/(factorial(2*(k-i))/(((factorial(k-i))^2)*(4^i)*(2*(k-i)+1)));
BR(i)=T(i)*(cos(atan(alfa(j))))^(2*(k-i)+1);
end;
suma2=suma2+BR(i)/(1+gpsk.*gamasr(j)/m)^k;
end;
Ps(j)=((M-1)/M)-K(j)*((pi/2+atan(alfa(j)))*suma1+sin(atan(alfa(j))*suma2));
Pb(j)=Ps(j)/log2(M);
end;
semilogy(gamasr_dB,Pb);
grid on
hold on
edin <edo_heineken@hotmail.com> wrote in message <5473317.1232049736743.JavaMail.jakarta@nitrogen.mathforum.org>...
> .......
> for k=1:(m-1)
> for i=1:k
> T(i)=(factorial(2*k)/(factorial(k)^2))/(factorial(2*(k-i))/(((factorial(k-i))^2)*(4^i)*(2*(k-i)+1)));
> BR(i)=T(i)*(cos(atan(alfa(j))))^(2*(k-i)+1);
> end;
> suma2=suma2+BR(i)/(1+gpsk.*gamasr(j)/m)^k;
> end;
> ........
I see something fishy here. In the line
suma2=suma2+BR(i)/(1+gpsk.*gamasr(j)/m)^k;
you are using the index i outside of the for-loop that was indexing with i. I think what you get will be the last value of i in the loop. I don't think that is what you had in mind. Perhaps you meant for the line to be inside the loop.
I"ve sent you a mail ,with a attach file, to your acount : sadik.hava@gmail.com about my problem and hope you can help me , because I don"t know how to add a attach in this forum. Thanks
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.