作者giordanolee (小克)
看板MATLAB
标题[问题] 请教non-existent field的错误
时间Wed Sep 18 14:49:29 2013
请教各位大大,我原来执行的matlab m-file如下(摘录前几行):
-----------------------
cfg = [];
cfg.dataset =
'NS_Epo.mat';
cfg.headerformat =
'gtec_mat';
cfg.dataformat =
'gtec_mat';
cfg.trialdef.eventtype =
'trial';
cfg.datafile =
'NS_Epo.mat';
cfg.headerfile =
'NS_Epo.mat';
cfg.continuous =
'yes';
-----------------------
在执行的时候便出现Error:
Reference to non-existent field 'log'.
Error in ft_read_header (line 1094)
log = tmp.log;
因此我循着此错误的警示讯息回头去找ft_read_header.m里面的部分,发现在我要跑
的line 1094 那里附近的code如下:
-----------------------
case 'gtec_mat'
% this is a simple MATLAB format, it contains a log and a names variable
tmp = load(headerfile);
log = tmp.log;
names = tmp.names;
hdr.label = cellstr(names);
hdr.nChans = size(log,1);
hdr.nSamples = size(log,2);
hdr.nSamplesPre = 0;
hdr.nTrials = 1; % assume continuous data, not epoched
% compute the sampling frequency from the time channel
sel = strcmp(hdr.label, 'Time');
time = log(sel,:);
hdr.Fs = 1./(time(2)-time(1));
% also remember the complete data upon request
if cache
hdr.orig.log = log;
hdr.orig.names = names;
end
------------------------
我把我认为出问题的部分用
粉红色标示出来了,但还是不知道怎麽解决,
目前应该是卡在这个环节没错,前面几行也都确实读进去了。
我有在想是不是headerfile读我的档案NS_Epo.mat读不到该有的data导致
我的NS_Epo.mat档案是EEG/MEG的数据档,应该是N*N的array(如果老板说的无误)。
不好意思这问题可能很好解决但我是新手才刚接任请各位大大帮帮忙....感激不尽
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.119.175.89