could anyone help me to solve the issue for the following code:
1 次查看(过去 30 天)
显示 更早的评论
code:
C=100;
A=10;
B=40;
A=20;
B=30;
A=30;
B=20;
A=50;
B=10;
A=60;
B=45;
D =(C.*log2(1+(A)*(B)))
for the above code i want to calculate D with respect to all A and B.But when i run the code it is considering only A=60 and B=45.Could anyone help me how to calculate D with respect to all A and B from the beginning
A=10;
B=40;
A=20;
B=30;
A=30;
B=20;
A=50;
B=10;
0 个评论
采纳的回答
KSSV
2018-4-12
A=[ 10 20 30 50];
B=[40 30 20 10] ;
D = zeros(size(A)) ;
for i = 1:length(A)
D(i) =C.*log2(1+A(i).*B(i)) ;
end
YOu have asked 221 questions so far....and still you stuck in basics of MATLAB. I strongly recommend you to read basic tutorials of MATLAB.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!