Because i
and j
are both functions denoting the imaginary unit:
- http://www.mathworks.co.uk/help/matlab/ref/i.html
- http://www.mathworks.co.uk/help/matlab/ref/j.html
So a variable called i
or j
will override them, potentially silently breaking code that does complex maths.
Possible solutions include using ii
and jj
as loop variables instead, or using 1i
whenever i
is required to represent the imaginary unit.