Date: Jan 14, 2013 1:27 PM
Author: Kate J.
Subject: Re: Problem with clearing text from axes

Thanks for your response, Bruno. 

>> We can't see the code that update the text beside first and last iteration.

Actually, the code *isn?t* being updated except at the first & last iterations; the value being displayed will be the same for all intermediate iterations, and I found that if I had updates performed at each intermediate step, it drastically slowed down the running speed of my code, which wasn?t acceptable. So, my intention is simply to display the desired value on the first iteration, and then to delete it on the last iteration.


>> It looks like you mix between text handle and string. What you call txtHandle is actually the string, and you forgot to keep track of the handle.

From the Mathworks documentation ( http://www.mathworks.com/help/matlab/ref/text.html ), it seems like the following code *should* work:

-----------------------------
set(axesHandle, 'Xlim', [-0.7 0.7], 'Ylim', [-0.2 0.7]);

TaskNumHandle = text(10,10,'Task # = 1');
set(TaskNumHandle, 'Color','k', 'FontWeight','bold');

drawnow;
------------------------------

However, no text gets displayed to the screen, only the original animation. Is there some other step that I?m missing here?

Given that the code that I showed in my original post *does* display text to the screen, but just doesn?t get deleted properly, does anyone have suggestions about how I might modify the original code shown, so that this text *is* deleted at each final iteration? Thanks!