Prev: Diff bet statement coverage and desicion coverage
Next: Changing the save button in figure windows
From: Luna Moon on 6 Jul 2010 08:57 Hi all, I have an Nx2 array, where the first column contains the timestamps and the second column contains the corresponding data. second | ts --------| -- 14:25:00| 18 14:25:02| 14 14:25:04| 11 14:25:06| 4 14:25:08| 24 14:25:10| 13 14:25:12| 12 14:25:14| 6 14:25:16| 21 14:25:18| 37 14:25:20| 21 14:25:22| 9 In Matlab, the first column becomes: 0.600694444496185 0.600752314785495 0.600810185191222 0.600868055596948 0.600925925886258 0.600983796291985 0.601041666697711 0.601099536987022 0.601157407392748 How do I plot such data with X-axis showing the timestamps (seconds) and the Y-axis showing the data? Thanks a lot!
From: dpb on 6 Jul 2010 09:09 Luna Moon wrote: .... > How do I plot such data with X-axis showing the timestamps (seconds) > and the Y-axis showing the data? doc datetick Altho unless datetick has been upgraded since my version w/ some additional flexibility you may have to simply plot the seconds values themselves to get a full precision scaling given the small variation shown. If this is just a very short subset so the overall time span is larger it may work. In the release here I got a "divide-by-zero" error in datetick but a sorta' half-baked scale in hh:mm:ss format which is the lowest resolution datetick can handle (again unless it's been improved). --
From: Steven Lord on 6 Jul 2010 09:28 "Luna Moon" <lunamoonmoon(a)gmail.com> wrote in message news:b44326d2-74a0-46af-99e6-5a017234459c(a)c10g2000yqi.googlegroups.com... > Hi all, > > I have an Nx2 array, where the first column contains the timestamps > and the second column contains the corresponding data. *snip* > In Matlab, the first column becomes: *snip* > How do I plot such data with X-axis showing the timestamps (seconds) > and the Y-axis showing the data? Use PLOT and DATETICK in that order. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: TideMan on 6 Jul 2010 16:02 On Jul 7, 1:28 am, "Steven Lord" <sl...(a)mathworks.com> wrote: > "Luna Moon" <lunamoonm...(a)gmail.com> wrote in message > > news:b44326d2-74a0-46af-99e6-5a017234459c(a)c10g2000yqi.googlegroups.com... > > > Hi all, > > > I have an Nx2 array, where the first column contains the timestamps > > and the second column contains the corresponding data. > > *snip* > > > In Matlab, the first column becomes: > > *snip* > > > How do I plot such data with X-axis showing the timestamps (seconds) > > and the Y-axis showing the data? > > Use PLOT and DATETICK in that order. > > -- > Steve Lord > sl...(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ:http://matlabwiki.mathworks.com/MATLAB_FAQ > To contact Technical Support use the Contact Us link onhttp://www.mathworks.com Alternatively, if the times are in t: t=(t-t(1))*86400; % to get time in s from start
|
Pages: 1 Prev: Diff bet statement coverage and desicion coverage Next: Changing the save button in figure windows |