dpb <email@example.com> wrote in message <firstname.lastname@example.org>... > On 4/15/2013 1:44 AM, PK wrote: > > "Nasser M. Abbasi" wrote in message <email@example.com>... > >> On 4/15/2013 1:09 AM, PK wrote: > ... > > >> > Timestamp= > >> > 201203291200000 > >> > 201203291215000 > >> > 201203291230000 > ... > >> > 201203291400000 > >> > 201203291415000 > >> > > ... > > >> > Now I want to plot Timestamp on x-axis and Data on y-axis so that I > >> can find > >> >the value of data at particular time. > >> > > >> > I have used > >> > plot (Data, Timestamp); > >> > but the output is awefuly different than ploting Data itself. > ... > > >> Should not this be: > >> > >> plot (Timestamp, Data ); > >> > >> normally one puts time on the x-axis, as things normally are function > >> of time? When you do plot(Data), then Matlab puts i=1:N on the > >> axis by default, where N is length of Data. > ... > > > as plot(A,B); plots A on y-axis and B on x-axis, plot (Timestamp, Data ) > > does not fix the issue. only swaps the axis. > > To see at least part of the problem and why you need datenums if want > other than ordinal x axis values, try > > diff(Timestamp(1:10)/10E2) > > at the command line and observe what you get... > > -- thanks for ur replies.
However,use of dn=datenum(ts(:,1:12),'YYYYmmddHHMM'); gives an error " ??? DATENUM failed. Failed on converting date string to date number."
I thinks the format 'YYYYmmddHHMM' is not valid.
if my timestamp were 2012-03-29-15-00, I could have used "YYYY-mm-dd-HH-MM".but its not the case.
again my time stamp are sorted and plot(x,y,'*') would not work either. please help.