Don't use i (the imaginary variable) for your loop index.
I handle a number of situations below.
for k = 1:1000
caption = sprintf('The value of k is %d', k);
set(handleToText, 'String', caption);
text(5, 10, caption);
Note the use of drawnow. If you're in an intensive loop, it often won't take time out to repaint your GUI until it's done with the loop. Thus you won't see any update on your screen. To get around this, use the drawnow command to force it to update/refresh/repaint the screen each time it's called.