code running endlessly without stopping
古いコメントを表示
I have the below Matlab code and it has been running endlessly without stopping. I have checked and could not detect any error on it.
% specify upper bound.
Iu=1;
% specify lower bound
IL=0;
% specify the probility matrix
Pyc = [0.9 0.05 0.05; 0.05 0.9 0.05; 0.05 0.05 0.9];
% specify the error
e = 0.008;
[N,M]=size(Pyc);
Pc=(1/M).*ones(M,1);
Qy=Pyc*Pc;
F=zeros (1,M);
while (Iu-IL)>e
end
for j=1:M
temp=0;
for k=1:N
temp = temp+((Pyc(k,j))*log((Pyc(k,j))/Qy(k)));
end
F(j)=exp(temp);
end
x=F*Pc;
IL=log2(x)
Iu=log2(max(F));
If (Iu - IL)<e
Cc=IL;
回答 (1 件)
Voss
2021 年 12 月 9 日
These lines:
while (Iu-IL)>e
end
define an endless loop, according to the values of the variables Iu, IL, and e you have defined.
カテゴリ
ヘルプ センター および File Exchange で WLAN Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!