MATLAB Answers


how to handle variable time stamped long time series data?

Asked by bushra raza on 20 Oct 2018
Latest activity Commented on by jonas
on 23 Oct 2018
Hello! i am working on time series data of sea water levels. one station data is in zrx format, and other is in excel(xls) format. i have to find the correlation between the two data sets in Matlab. time stamps of both files are not syncronized. and i have to correlate the data on same time stamp. please guide me, should i shift my data to timetable. and then start my analysis? or how should i start it ?
thanks in advance.


Sign in to comment.

1 Answer

Answer by jonas
on 20 Oct 2018
Edited by jonas
on 20 Oct 2018
 Accepted Answer

  1. Load data
  2. Put data in two timetables
  3. Use synchronize
  4. Step 1-3 did not work? Upload the data.


Sure, this should give you the difference, assuming you have two timetables TT1 and TT2.
TTdiff = TT1{:,1} - TT2{:,1};
You could also add this as a new column in your timetable:
TT1.diff = TT1{:,1} - TT2{:,1};
You can index tables in many different ways... What you need to remember is that accessing the content of a table is done through use of curly braces {}.
Actually, this is a general rule for MATLAB. Curly braces returns the content of whatever you put in whereas normal braces return the same class as you put in.
a great help indeed. thank full to you
can you please also guide me: how can i save this calculation with timestamp in a separate data file or so?
Ive never done this, but you can probably use this
T = timetable2table(TT)
writetable(T, 'file.txt')
where TT is your timetable.

Sign in to comment.