Using i and j as variables in MATLAB
Asked 07 September, 2021
Viewed 1.9K times
  • 56
Votes

i and j are very popular variable names (see e.g., this question and this one).

For example, in loops:

for i=1:10,
    % Do something...
end

As indices into a matrix:

mat(i, j) = 4;

Why shouldn't they be used as variable names in MATLAB?

9 Answer