I want get matrix
1 回表示 (過去 30 日間)
古いコメントを表示
matrix_FA=zeros(SSf,SSa);
Ln_total=0;
while Ln_total<round(C0*SSf*SSa)
Type=randi(2); %,1:P->A; 2:A->P
if Type==1
if rand<=P_N
f_si=randsrc(1,1,[1:SSf;F_site/sum(F_site)]);
else
f_si=randsrc(1,1,[1:SSf;1/SSf*ones(1,SSf)]);
end
si_part=ceil(4*f_si/SSf);
if rand<=P_Q
A_rang=1+(si_part-1)*SSa/4:si_part*SSa/4;
A_dens=A_site(1+(si_part-1)*SSa/4:si_part*SSa/4);
else
A_rang=1:SSa;
A_dens=A_site;
end
if rand<=P_N
a_si=randsrc(1,1,[A_rang;A_dens/sum(A_dens)]);
else
a_si=randsrc(1,1,[A_rang;1/length(A_rang)*ones(1,length(A_rang))]);
end
please help me how they create this matrix
1 件のコメント
Walter Roberson
2023 年 8 月 1 日
You initialize matrix_FA but you never store anything into it?
You calculate several variables but you do not take copies of them each iteration, so the final result stored in them is going to be whatever was stored in the last iteration.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!