How to concatenate time traces and fill up missing data?
3 次查看(过去 30 天)
显示 更早的评论
Hello all,
I have a problem concerning concatenation of contiguous data with little gaps in it and am trying to find a workaround. I have several data that are stored as n x 2 arrays in the matlab workspace that I want to combine to one n x 2 array. The data come from electrophysiological recordings, the first columns contain time in seconds and the second current in Ampere. They are stored in different traces that all come from an almost contiguous recording. I want to concatenate these traces to store them all in one vector to export them for further analysis in a different program which is able to read in a simple text file.
Now my problem is that the concatenated vector contains little gaps which make further analysis impossible. My recording has a continuous sampling rate of 25kHz and I would like to fill in the gaps with the same sampling rate. The value in the second column can easily be any constant as I only need to create a vector of contiguous data.
I looked in the documentation and only found some possibility in simulink, but is there any ideas on a solution for this problem in matlab? My only idea so far would be creating a loop that creates a vector containing the missing values. Is there any better solution? I'm also happy about a link to the documentation of the functions I need for this as I couldn't find the right ones!
Thanks!
Flo
0 个评论
回答(1 个)
Nipun Katyal
2020-8-16
Hi,
The problem mentioned above can be tackled using fillmissing function all you to do is generate a time vector according to your sampling rate, fill the current values if they are in one of your nX2 arrays otherwise fill it with Nan. With the help of this function you can fill those values either to the nearest value or one of the other options there exist.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!