필터 지우기
필터 지우기

Segmenting EEG data into 1 second segments

조회 수: 12 (최근 30일)
Shamus Sim
Shamus Sim 2020년 8월 11일
댓글: Cris LaPierre 2020년 8월 12일
I have a EEG timeseries called ts which has a total length of 600 seconds.
Common Properties:
Name: 'unnamed'
Time: [239766x1 double]
TimeInfo: tsdata.timemetadata
Data: [1x1x239766 double]
DataInfo: tsdata.datametadata
I would like to split the data tsout into 1s windows. For instance ts1 has data from 0-1s and ts2 has data from 1-2s and so forth.
This is the code I have used.
for i=1:600
ts{i} = getsampleusingtime(ts,i-1,i)
end
This is the error I have got.
Unable to perform assignment because brace indexing is not supported for variables of this type.

채택된 답변

Cris LaPierre
Cris LaPierre 2020년 8월 11일
The issue is the curly braces. Use parentheses instead.
for i=1:600
tsout(i) = getsampleusingtime(ts,i-1,i);
end
  댓글 수: 2
Shamus Sim
Shamus Sim 2020년 8월 12일
I get tsout to be a timeseries object which has 1x600 timeseries.
However, this is how I would like to change the data. I would like to split the data tsout into 1s windows. For instance ts1 has data from 0-1s and ts2 has data from 1-2s and so forth.
Thank you Cris!
Cris LaPierre
Cris LaPierre 2020년 8월 12일
That is what you get out. The question, I guess, is what format would you like it in? Here, you would access the first second of data using tsout(1).Data, the second second using tsout(2).Data, etc.
I did notice that getsampleusingtime includes data with timeval >= starttime and <= endtime. This means data on the edges are included in 2 bins - when the time is the endtime in one group and the starttime in another.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Biomedical Signal Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by