Feed on
Posts
Comments

to parse a text file in matlab that can’t be read using the ‘load’ command, you can use fgetl in the following manner:

fid = fopen(‘file.name’);
while 1
tline = fgetl(fid);
if ~ischar(tline)
break
end

tline
end


Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

2 Responses to “parse a text file in matlab”

  1. on 18 May 2010 at 1:48 pm Nawaf

    I need to do some kind of statistics on text files, like parsing by words and counting number of words and repetition for each word too. how can I do that by matlab? please help

  2. on 18 May 2010 at 1:49 pm Nawaf

    I need to do some kind of statistics on text files, like parsing by words and counting number of words and repetition for each word too. how can I do that by matlab? please help, please reply to my email.

Did I get this wrong? Let me know!

Trackback URI | Comments RSS

More blogs about http://desk.stinkpot.org:8080/tricks.