Error using evalc Unrecognized function or variable 'edfmex'.

2 Ansichten (letzte 30 Tage)
Qianhui
Qianhui am 22 Jun. 2023
Beantwortet: Neha am 26 Jun. 2023
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!

Akzeptierte Antwort

Neha
Neha am 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!

Weitere Antworten (0)

Kategorien

Mehr zu EEG/MEG/ECoG finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by