问题描述
EEG矩阵的维度表示通道数,采样点数,段数,即在10s持续时间的EEG数据保存段中,我们有8个通道,5121个采样点和30个段。
属性:
sample_rate 1x1 8
double ssvep0Hz 8x5121x30 9832320
double ssvep10_7143Hz 8x5121x30 9832320
double ssvep12_5Hz 8x5121x30 9832320
double ssvep15Hz 8x5121x30 9832320
double ssvep9_375Hz 8x5121x30 9832320
double time 1x5121 40968
double
我无法绘图,因为它是 3d 数据,我不知道如何处理通道段和采样点。
解决方法
如果我理解正确,您想根据存储在 ssvep*
变量中的时间绘制存储在 time
变量中的测量电压的一段(第三索引)。您是否尝试过以下方法来绘制 ssvep0Hz
变量的第 5 段:
%% Generate some data
sampleRate = 5.120; % sample rate in kHz
nSamples = 10*(1000*sampleRate); % time_seconds*sampleRate_Hz)
ssvep0Hz = rand(8,nSamples,30)+repmat((1:8)',1,nSamples);
time=(1:nSamples)/(sampleRate*1000);
%% specify a segment and extract series
segmentNumber=5; % Specify segmentNumber
extractedSegment = ssvep0Hz(:,:,segmentNumber); % use colon operator `:` to extract all elements in the first two dimension and `segmentNumber to extract a specific index in the third dimension
%% Plot the data and format
plot(time,extractedSegment);
% add axis label and legends
xlabel('Time (s)');
ylabel('Data');
legend;
这是上面代码的情节