MATLAB: Could anyone help me to find the solution for the issue

throughput

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]

Best Answer

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)))