Error using evalc Unrecognized function or variable 'edfmex'.
9 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Neha
on 26 Jun 2023
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 Comments
More Answers (0)
See Also
Categories
Find more on Web Services in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!