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
Jan 2018 年 2 月 26 日
Which problem do you have with the posted code?
VISHALI V
VISHALI V 2018 年 2 月 27 日
how to take arg max for the equation i attached in my question
Walter Roberson
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
VISHALI V 2018 年 3 月 8 日
please refer above equation i have attached ,i wrote code for that equation ,for that equation how to i take arg max there P is a power allocation vector P=[p1,p2,p3.....pk]T T is a transpose,please reply it fast .
Walter Roberson
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
VISHALI V 2018 年 3 月 9 日
thank you sir

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeWireless Communications についてさらに検索

質問済み:

2018 年 2 月 26 日

コメント済み:

2018 年 3 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by