how to write matlab code for this equation?
이전 댓글 표시
sa=0;
for a=1:K
sa=sa+log2(1+r(a)/U);
end
display(sa)
as = 1*10^-10;
bs= 1*10^-5;
rs = (bs-as).*rand(K,1) + as;
pow=0;
for d=1:K
pow=pow+((Ptot(d)/U)+rs(d));
end
display(pow)
ptc=1*10^-3;
par=pow+ptc
nreee=sa/par
댓글 수: 6
Jan
2018년 2월 26일
Which problem do you have with the posted code?
VISHALI V
2018년 2월 27일
Walter Roberson
2018년 2월 27일
fmincon the negative of the function to search for the argument that maximizes the function over a continuous domain. Over a discrete domain... Try them all.
VISHALI V
2018년 3월 8일
Walter Roberson
2018년 3월 8일
You are using a discrete domain of pk. To find the pk that maximizes the equation, try them all, and use the two-output form of max() to identify the index that returns the largest value.
VISHALI V
2018년 3월 9일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Wireless Communications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!