[問題] 請教non-existent field的錯誤

看板MATLAB作者 (小克)時間12年前 (2013/09/18 14:49), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
請教各位大大,我原來執行的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
文章代碼(AID): #1IEKpyDf (MATLAB)