Error using evalc Unrecognized function or variable 'edfmex'.
4 次查看(过去 30 天)
显示 更早的评论
Hi I am trying to use a batchFileConverter function to convert edf to .m file format.
function batchFileConverter_Dataset1()
sourceFolderName = './rawData/';
destFolderName = './matlabData/';
rawFiles = dir([sourceFolderName '*.edf']);
nFiles = length(rawFiles);
% Disp file information:
printToConsole('L1');
printToConsole(1, 'Processing %i files...\n', nFiles);
% Loop through files:
for fileIndx = 1:nFiles
edfDataConverter([sourceFolderName rawFiles(fileIndx).name]...
,[destFolderName rawFiles(fileIndx).name(1:end-4) '.mat'])
printToConsole(2, 'Done with file %i.\n',fileIndx);
end
printToConsole(2, 'Done with folder.\n');
printToConsole('L2');
end
%% edfDataConverter Function:
function edfDataConverter(edfFilename,matFilename)
% edfDataConverter Converts a single edf file to a matlab file.
% Read raw edf file:
hMex = @edfmex; %#ok<NASGU>
[~,rawEDF] = evalc(['edfmex(''' edfFilename ''');']);
The errors are:
Unrecognized function or variable 'printToConsole'.
Error in batchFileConverter_Dataset1 (line 49)
printToConsole('L1');
Error using evalc
Unrecognized function or variable 'edfmex'.
Error in batchFileConverter_Dataset1>edfDataConverter (line 71)
[~,rawEDF] = evalc(['edfmex(''' edfFilename ''');']);
Can someone tell me how to solve this problem? Thank you!
0 个评论
采纳的回答
Neha
2023-6-26
Hi Qianhui,
I understand that you are facing errors about the unrecognized functions: "printToConsole" and "edfmex".
Since the code is from this GitHub repository: Pupil Size, these are helper functions added by the developer and are not built-in MATLAB functions.
I suggest you load the all the other files in this repository and then try to execute the script. You should not be facing any errors thereafter.
I hope this helps!
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 EEG/MEG/ECoG 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!