I want to implement this code but I am unable to do so...
for m = 3:-1:-3
for n = 3:-1:-3
Y( m,n) = G(center_index + (m-n)) + (-1i*m*w*C(center_index + (m-n)));
end
end
G and C are vectors.
Can someone please help?

 Respuesta aceptada

Alan Stevens
Alan Stevens el 15 de Feb. de 2021

0 votos

Like this
m = 3:-1:-3;
n = 3:-1:-3;
for i = 1:numel(m)
for j = 1:numel(n)
Y( i,j) = G(center_index + (m(i)-n(j))) + (-1i*m(i)*w*C(center_index + (m(i)-n(j))));
end
end

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 15 de Feb. de 2021

Comentada:

el 15 de Feb. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by