could anyone help me to solve the issue for the following code:

1 vue (au cours des 30 derniers jours)
Prabha Kumaresan
Prabha Kumaresan le 12 Avr 2018
Réponse apportée : KSSV le 12 Avr 2018
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;

Réponse acceptée

KSSV
KSSV le 12 Avr 2018
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.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by