MATLAB: Assign a letter to a set of (for example) real numbers

assigning lettersfor loop

I am going through a book which is teaching the basics of m files, and one loop they have done is:
for i = 1:m
for j = 1:n
A(i,j) = a/(i + j – 1);
end
end
A
However matlab doesn't understand what " i = 1:n" means, and neither do I. I am guessing it is the set of all real numbers or integers from 1 to n, but maybe because it hasn't been set, matlab doesn't know what it is?
How would I fix this?

Best Answer

No, the problem is that n, m & a are unknowns!
set for example
n=2;
m=2;
a=10
for i = 1:m
for j = 1:n
A(i,j) = a/(i + j - 1);
end
end