Kate J.
Posts:
159
Registered:
6/9/11
|
|
Re: Problem with clearing text from axes
Posted:
Jan 14, 2013 9:34 PM
|
|
Thanks for your response, Bruno.
>> (10,10) is outside the axe limits, therefore I'm not surprises you won't see anything displayed.
Thanks for the tip. Using smaller values allows the following lines to display when it's located within my Start() function:
TaskNumHandle = text(0.3,0.6,'Task # = 1'); set(TaskNumHandle, 'Color','k', 'FontWeight','bold');
--------------------------------------------------
>> You should also enforce the axes by calling: >> text(..., 'Parent', axesHandle)
However, if I add this line to the Start() function:
text(0.3,0.6,'Task # = 1', 'Parent', axesHandle);
... it causes the "Task # = 1" line to be overwritten over itself, so that every character becomes dark by the final iteration, which is not what I want. If there is no important reason why the above line *needs* to be included, I would prefer to omit it...
-----------------------------------------------------
The big problem is that if I try to include the following code within my Update() function:
if(iteration == 0) TaskNumHandle = text(0.3,0.6,'Task # = d', taskNumber); set(TaskNumHandle, 'Color','k', 'FontWeight','bold'); end if(iteration == endCondition) delete(taskNumHandle); end
... the code won't even run, and returns the errors:
~ Error evaluating registered method 'Update'...
~ Invalid parameter/value pair arguments
I don't understand why this code would run without problems within the Start() function, but then cause an error within Update()... I commented-out the 2nd part of the code above, and it still returns the same errors. Any ideas about what might be wrong? Thanks for your help.
|
|