Path: news.mathworks.com!not-for-mail
From: "Ben " <ben.cowley@helsinki.fi>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Compiled Matlab fgets error
Date: Wed, 12 Sep 2012 06:14:09 +0000 (UTC)
Organization: Helsingin Yliopiston Observatorio
Lines: 5
Message-ID: <k2p97h$bh5$1@newscl01ah.mathworks.com>
References: <k2o940$q1o$1@newscl01ah.mathworks.com> <k2oa8k$g25$1@speranza.aioe.org> <k2p4l7$qf6$1@newscl01ah.mathworks.com>
Reply-To: "Ben " <ben.cowley@helsinki.fi>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1347430449 11813 172.30.248.48 (12 Sep 2012 06:14:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 12 Sep 2012 06:14:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3269771
Xref: news.mathworks.com comp.soft-sys.matlab:778298

Argh, I just realised my message above was in error - I was talking about subdirectories but in the code I posted it had not even reached the part where it explores subdirectories. 

So the code is valid but scratch the bit about directories :)
So then I know the path is good, the file is there, and the code executes file IO on other files from the same dir. 
I tried moving the eeglab toolbox to the same folder as the code I am compiling, but didn't help.