Referencing common set from two similar matrices
이전 댓글 표시
Hi,
I have a two large sets of time series from two instruments to compare to each other. The time series come from about 70 distinct days, and both instruments recorded on each of these days.
Time series (t0 to tn) from instrument X and from instrument Y are both reported at 1 HZ, both as seconds since midnight, both continuous and monotonically increasing, (e.g. 11201, 11202, 11203...), are always in column 1, but are not always identical in length (i.e. number of time steps). Sometimes, X starts before Y, sometimes Y before X. Sometimes X ends before Y, sometimes Y before X. There is always overlap, however.
I'm interested in finding the common set of these time series as simply as possible, and then would like to reduce each to that common length. The two time series have different numbers of columns, though (one reports just 3 variables, while another reports 10), so the two final files will only be dimensionally identical in number of rows.
My grasp of logical indexing, find functions and higher level Matlab functions is still pretty new, so I've been going about this with a series of FOR and IF statements that involve lots of variables comparing values of timestep(t0) and t(n). However, my code is getting far too long and is generating too many variables. I'm sure the same can be done MUCH more easily if I knew how. And, since there are a lot of these files, excessive IF/FOR statements like I'm doing really bog down the code.
Can anyone suggest how to go about this efficiently? I'm capable of writing the eval functions that run the same processes on multiple different, but similarly-formatted file names, but just getting those sets the same length has me stuck...
Many TIA, Jonathan
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!