0

I'm trying to import an ASCII file to Matlab in order to manipulate it,I used: importdata(filename)

but the point is it did not load the complete file in to Matlab,I mean after importing I'm taking a struct and inside that there is not all of my ASCII file's data.

I would really appreciate any help regarding that.

best,Navid

Navid
  • 29
  • 1
  • 4
  • [This solution](http://stackoverflow.com/a/20154448/2778484) might be helpful. The examples are for comma delimiters, but you can change it to space or whatever. – chappjc Nov 22 '13 at 22:03

1 Answers1

0

Unless your data is organized in some specific manner you might just want to use fread. Here you can also specify how many bytes of the file you'd like to read or leave it as is and it will read the file in its entirety.

fid = fopen('myfile.txt','rt'); %//get the file handle and set it for reading
myData = fread(fid,inf) %//inf is not necessary, but that is how you would use the parameter, an integer is also a valid input

If your data is delimited please provide an example in order for anyone to give you some real insight into what might be going wrong.

rayryeng
  • 102,964
  • 22
  • 184
  • 193
Falimond
  • 608
  • 4
  • 11