Reading ".edf" file

5 views (last 30 days)
Alberto Failla
Alberto Failla on 8 Dec 2019
Commented: dpb on 8 Dec 2019
Hi,
I am using a code (EEG analysis) I got from another person, and she said it is working perfectly for her.
--> So, the main problem I that MATLAB says:
"Error: File: extract_ASI.m Line: 20 Column: 73
Invalid text character. Check for unsupported symbol, invisible character, or
pasting of non-ASCII characters."
--> The filename is : "Pseudo_Results001-914-721-1_1_1_RAW" and it seems like the code is bothered by the "_" (aka. underscore)
I tried to change the file name and removing the underscores (i.e. "Pseudo_Results001-914-721-112RAW") but in that case the error is:
"Error: File: extract_ASI.m Line: 20 Column: 75
Invalid expression. Check for missing multiplication operator, missing or
unbalanced delimiters, or other syntax error. To construct matrices, use brackets
instead of parentheses."
--> Then I tried to remove the 'RAW' as it seemed like that was annoying MATLAB, and again, an error:
"Unrecognized function or variable 'Pseudo_Results001'.
Error in extract_ASI(line 20)
[dat, hdr, label, fs, scle, offs] = read_edf(Pseudo_Results001-914-721-112);"
Do you have any clue why it may not been working?
PS. The girl that gave me the code said it was working perfecly for her !
  2 Comments
Max Murphy
Max Murphy on 8 Dec 2019
It looks like the function read_edf makes a call at some point to the function extract_ASI. My best guess is that extract_ASI parses variable names for extracting metadata regarding your EEG recordings using elements from a specific naming convention in the file name or header of your .edf file. Without code from the function extract_ASI, it is impossible to debug.
dpb
dpb on 8 Dec 2019
The errors don't seem to have anything whatsoever to do with the file name but the content of the file.
The first message explicitly tells you it found a non-ASCII text character in the data file you gave it.
The others are all variations on a theme; the format of your file doesn't match up with what the parser expects as Max says above...however, besides the code would also have to have the definition of what the format of an .edf file structure is and the data itself.
First thing I'd do is to have this other person give you the file she's using and double-check that your installation will actually read that file.
Presuming that's the case, the problem is probably owing to differences in versions of the software that generated the two files and the parser she's using not up to the (I'm guessing here some) more recent version of a file you have compared to hers.
Does the vendor have tools available to import into MATLAB and/or export?

Sign in to comment.

Answers (0)

Categories

Find more on EEG/MEG/ECoG 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!