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

1 visualización (últimos 30 días)
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;

Respuesta aceptada

KSSV
KSSV el 12 de Abr. de 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.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by