From: Walter Roberson on
Khanh wrote:
> First of all, please calm down :P and thank you for your suggestions.
> Secondly, I tried the method you mentioned even before you suggesting
> me, so no, it doesn't work, that's why I still need help. Have you had
> time to try and see it yourself? Yes, I used %05d or %04 for 5 digits
> and 4 digits whatsoever.
> I used "fid=fopen(filename)" just to put variable name for the opened file.

I don't have your data files and if I had them I do not have a Windows PC to
put them in the exact same directory with the exact same permissions and
ownership that you have established. So No, I have not tried it myself.

I would be unlikely to write the code that way for myself: I would probably
use dir() to actively determine which files existed.
From: Walter Roberson on

> Khanh wrote:

>> filename = sprintf('H:/Summer
>> 10/Sootformation/nheptane/RUN_%d/closed_homogeneous__ignition_delay.out',
>> k);

So you are using Windows as your OS.

>> fid=fopen(filename);

And you open the file for reading there

>> tline=fgetl(fid);

And there you try to read a line from the file, which implies that the file is
line-oriented, which implies that it is a text file.

Now go to
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/fopen.html
and read the details of the optional input argument named "permission". *All*
of the details.