The Data Tip Text Update Function

pos = get(event_obj,'Position');
x = pos(1); y = pos(2);
output_txt = {['Y: ',num2str(y,4)]};
is straight out of the documentation, but for the life of me i can not figure how to get the following to work:
output_txt{end+1} = {['X: ',num2str(x,4)]};
i have tried all sort of things to num2str(x,???) to no avail. any insight is appreciated.

 Risposta accettata

Fangjun Jiang
Fangjun Jiang il 28 Giu 2011

0 voti

I think it should be:
output_txt{end+1} = ['X: ',num2str(x,4)];

1 Commento

you are amazing. i can see now that the fist out_txt is the only one with {} because of the {end+1}. thanks so much.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by