MATLAB Answers

Why does the function call "function [hdr, record] = edfReadOddur( 'tinnaprim​e.edf',var​argin )" give an error?

4 views (last 30 days)
This is the error message:
Error: File: edfReadOddur.m Line: 1 Column: 40 Unexpected MATLAB expression.

Accepted Answer

Geoff Hayes
Geoff Hayes on 25 Jul 2017
Oddur - if your function signature (the first line in edfReadOddur.m) is written as
function [hdr, record] = edfReadOddur( 'tinnaprime.edf',varargin )
then the problem is that you are trying to set the first parameter of your function as a string rather than as an input parameter/variable. Your signature should be defined as
function [hdr, record] = edfReadOddur( filename, varargin)
and you would call the above (from the command line or another piece of code) and pass in 'tinnaprime.edf' to populate/set the filename parameter
>> edfReadOddur('tinnaprime.edf')
See Function Basics for more details.
  3 Comments
Oddur Bjarnason
Oddur Bjarnason on 26 Jul 2017
Again I tried to take your suggestions into account. I used the following function signature:
function [hdr, record] = edfReadUntilDone(tinna, varargin)
I called the function with:
edfReadUntilDone('C:\Users\Oddur\Documents\Emotiv Files\Tinna\tinnaprime.edf')
I got the following answer:
ans =
struct with fields:
ver: 0
patientID: 'tinna '
recordID: '2 '
startdate: '01.05.16'
starttime: '20.18.56'
bytes: 10496
records: 636
duration: 1
ns: 40
label: {1×40 cell}
transducer: {1×40 cell}
units: {1×40 cell}
physicalMin: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
physicalMax: [1×40 double]
digitalMin: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
digitalMax: [1×40 double]
prefilter: {1×40 cell}
samples: [1×40 double]
frequency: [1×40 double]
From this I gather that the file has been loaded. I do unfortunately not get any data records.
The original question that I posed has now been answered so I shall accept your answer. The rest of the problems I have with the function I shall take up with Brett.
Thank you.
Oddur

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!