Date: Apr 17, 2013 10:51 AM
Author: dpb
Subject: Re: Pairing two different values on one plot

On 4/17/2013 12:53 AM, PK wrote:

> I still cant get the time in data cursor.
> please help.

Oh, I see I misread--I thought you were reporting success.

Can you get the example to work w/ replacing the num2str() w/ a call to
datestr() first? I did by using

function txt = myupdatefcn(empt,event_obj)
% Customizes text of data tips

pos = get(event_obj,'Position');
s=sprintf('%10s 00:00:%2.2d',datestr(fix(now)),pos(1));
txt = {['Time: ',s],...
['Amplitude: ',num2str(pos(2))]};

It gives the current date w/ the ordinal number of the axis point pos(1)
displayed as the seconds.

Your posted code looks like should work--if it isn't I wonder if you
saved the m-file of the update function in a location that is on the


which myupdatefcn

from the command line and see if it is found...