필터 지우기
필터 지우기

Manipulation of data for plotting

조회 수: 6 (최근 30일)
Rudy Steel
Rudy Steel 2020년 12월 26일
댓글: Cris LaPierre 2020년 12월 26일
When opening raw data obtained from github I found it to be of a 4D structure. So basically, the dataset that I am using being s9.mat is of size 12 x 8 x 1114 x 15:
[Number of targets, Number of channels, Number of sampling points, Number of trials] = size(eeg)
From the github site it is being told that the stimulation was shown at the 39th sample so I need to ignore the first 38 samples when processing, reducing the data to 12 x 8 x 1076 x 15. I also need to consider only the first 10 trials so I will be working on a dataset of size 3 x 8 x 1076 x 10. I require to process this data (filtering etc) however to do so I first have to extract from the dataset a 1 x 1076 vector, which represents one trial (corresponding to a stimulus frequency of 9.25Hz, recorded at one of the 8 channels) and then I can apply my filter to this vector of data.
So my problem is how I can obtain the 1 x 1076 vector so that I could proceed with further processing. Would appreciate if anyone can guide me as to how I can obtain this vector.

채택된 답변

Cris LaPierre
Cris LaPierre 2020년 12월 26일
편집: Cris LaPierre 2020년 12월 26일
Not sure how you went from 12 to 3 in your first dimension, but use indexing to reduce your data down to 12 x 8 1076 x 10.
newVar = origData(:,:,39:end,1:10)
To extract a single stimulation from a single target and a single channel for a single trial, you could do this.
% 1076 points from target 1, channel 2, trial 3
singleStim = origData(1,2,39:end,3)
To make it 1x1076, you might need to enclose everything in the function squeeze
singleStim = squeeze(origData(1,2,39:end,1))
  댓글 수: 2
Rudy Steel
Rudy Steel 2020년 12월 26일
It works thank you however, I obtained the data as 1076x1 do you know as to why that occurs?
Cris LaPierre
Cris LaPierre 2020년 12월 26일
This is because squeeze removes all the singleton dimensions, which leaves you with 1076. It keeps that as the first dimension and adds the "x1" since it has to have a second dimension.
You just need to transpose the result using an apostrophe.
a = [1;2;3;4;5]
a = 5×1
1 2 3 4 5
b = a'
b = 1×5
1 2 3 4 5

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by