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?

 Réponse acceptée

Alan Stevens
Alan Stevens le 15 Fév 2021

0 votes

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

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by