Info

此问题已关闭。 请重新打开它进行编辑或回答。

How I can insert rows of zeros at beginning of a smaller matrix (X) until value of X(1,1) is less than or equal to first value encountered in column 1 of a longer matrix Y by n rows? n varies based data for Y. Resizing array X to be same size as Y.

1 次查看(过去 30 天)
Can you please help with how I can insert rows of zeros at the beginning of a smaller matrix (X) until the value of X(1,1) is less than or equal to the first value encountered in column 1 of a longer matrix Y by n rows? The row length n will always vary due to different data files imported for Y. The intent is to resize X to size of Y.
  5 个评论
Thomas Gunther
Thomas Gunther 2018-4-12
Stephen, you are correct. The sampling times would likely be off by some small amount. I'm not sure if I follow if I interpolate to one common timebase (TB1), my issue would be resolved. The start time of INST-3 will still be off by TB1 + x seconds from INST-1 with its start time of TB1. Wouldn't I still have a smaller array for INST-3 than INST-1? Granted we would now know the exact time when INST-3 was turned on when the first data point taken occurs at the same point in time along TB1 when INST-1 is recording data. I still need to rectify the difference in array sizes for data analysis.
Stephen23
Stephen23 2018-4-12
编辑:Stephen23 2018-4-12
@Thomas Gunther: there are two separate topics to consider here:
  1. finding a common epoch (i.e. synchronizing to the same time).
  2. ensuring that the samples occur at the same time (e.g. interpolating, subsampling), if required.
Basically you have this:
TB1: S1 S2 S3 S4 S5 S6 ...
TB2: S1 S2 S3 S5 ...
TB3: S1 S2 S3 S4 S5 ...
Were they started by the same trigger, or do they use the same time signal? Do you have a common epoch for the sample times? Once you have that, then I see no reason why you could not interpolate, if required. If the samples are spread widely then interpolation may not be useful anyway. It depends on your data.

回答(0 个)

此问题已关闭。

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by