i can either be the index or a value that you use on the RHS of your equations but typically not both. To fix your code you could add a counter, c, for indexing the positions in x and y
c = 1;
for i = 0:5:100
x(c) = i;
y(c) = i^2;
c = c + 1;
end
figure()
plot(x,y)
Here are two other, preferable, ways you could plot it:
1.
figure(), fplot(@(x) x.^2, [0 100])
2.
x = 0:5:100;
y = x.^2;
figure(), plot(x,y)