could anyone help me to find the solution for the issue

1 回表示 (過去 30 日間)
Prabha Kumaresan
Prabha Kumaresan 2018 年 4 月 12 日
コメント済み: KSSV 2018 年 4 月 12 日
could anyone help me to solve the issue for the following code: G_part=[5 9 0 0 5; 2 6 0 0 4] G_part=[0 0 4 2 0; 0 0 3 1 0] P_part=[1 3 0 0 2; 4 5 0 0 6] P_part=[0 0 5 7 0; 0 0 6 8 0]
for j=1:size(G_part,2)
for i=1:size(P_part,1)
throughput(i,j) =(C.*log2(1+(P_part(i,j)).*(G_part(i,j))))
end
end
for the above code the throughput was calculated with respect to G_part=[0 0 4 2 0; 0 0 3 1 0] and P_part=[0 0 5 7 0; 0 0 6 8 0]
could anyone tell me how to calculate the throughput with respect to
G_part=[5 9 0 0 5;
2 6 0 0 4] and
P_part=[1 3 0 0 2;
4 5 0 0 6]
  1 件のコメント
KSSV
KSSV 2018 年 4 月 12 日
surprising......and funny question. It is not clear.

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

採用された回答

KSSV
KSSV 2018 年 4 月 12 日
YOu need not to use a loop:
G_part=[5 9 0 0 5;
2 6 0 0 4] ;
P_part=[1 3 0 0 2;
4 5 0 0 6] ;
throughput =(C.*log2(1+(P_part).*(G_part)))
  3 件のコメント
Prabha Kumaresan
Prabha Kumaresan 2018 年 4 月 12 日
The following code which I am trying to solve:
G_part=[5 9 0 0 5;
2 6 0 0 4]
P_part=[1 3 0 0 2;
4 5 0 0 6]
G_part=[0 0 4 2 0;
0 0 3 1 0]
P_part=[0 0 5 7 0;
0 0 6 8 0]
G_part=[0 0 1 5 0;
0 0 4 1 0]
P_part=[0 0 3 4 0;
0 0 5 6 0]
G_part=[1 2 0 0 7;
3 4 0 0 6]
P_part=[3 4 0 0 1;
7 8 0 0 2]
G_part=[0 0 1 6 0;
0 0 4 5 0]
P_part=[0 0 3 4 0;
0 0 5 6 0]
C=20;
throughput =(C.*log2(1+(P_part).*(G_part)))
I want to calculate the throughput for all G_part and P_part.But when i run the code it is considering the G_part and P_part at the last.Could you please help me how to calculate the throughput with respect to the remaining G_part and P_part from the beginning.
KSSV
KSSV 2018 年 4 月 12 日
Read about cell or 3D matrix.
G_part{1}=[5 9 0 0 5;
2 6 0 0 4] ;
P_part{1} =[1 3 0 0 2;
4 5 0 0 6] ;
G_part{2}=[0 0 4 2 0;
0 0 3 1 0] ;
P_part{2}=[0 0 5 7 0;
0 0 6 8 0] ;
G_part{3}=[0 0 1 5 0;
0 0 4 1 0] ;
P_part{3}=[0 0 3 4 0;
0 0 5 6 0] ;
G_part{4}=[1 2 0 0 7;
3 4 0 0 6] ;
P_part{4}=[3 4 0 0 1;
7 8 0 0 2] ;
G_part{5}=[0 0 1 6 0;
0 0 4 5 0] ;
P_part{5}=[0 0 3 4 0;
0 0 5 6 0] ;
C=20;
N = length(G_part) ;
throughput = cell(N,1) ;
for i = 1:N
throughput{i} =(C.*log2(1+(P_part{i}).*(G_part{i}))) ;
end

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by