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?

 Accepted Answer

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

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!