How to concatenate time traces and fill up missing data?

조회 수: 4 (최근 30일)
Florian Wildner
Florian Wildner 2020년 8월 10일
답변: Nipun Katyal 2020년 8월 16일
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

답변 (1개)

Nipun Katyal
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.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by