Why is Matlab not importing my entire file when using importdata?
8 views (last 30 days)
Show older comments
orhchand
on 30 Aug 2017
Commented: Walter Roberson
on 9 Apr 2019
I tried to import a gcode file into Matlab using importdata. However, only the first 60 lines (over 400+) were imported. I deleted the empty lines in my gcode file and more lines were imported into Matlab. However, i can't get all my data imported.
2 Comments
the cyclist
on 30 Aug 2017
Did you try using the Import Data gui (on the command window)? When you do it from there, it will visually show the range of values that will be imported. You might be able to glean why it is stopping at that row.
Accepted Answer
Walter Roberson
on 31 Aug 2017
The fact that you had empty lines in your file tells us that your file is not a simple file in which there is (possibly) a header line, after which each line is a numeric array that is the same length on every line. importdata() can figure out some things about headers, but once it is into the part that it figures is numeric data, then any change in the numeric format will typically cause importdata() to stop importing the data.
3 Comments
Rebecca McDonald
on 9 Apr 2019
I have a similar situation with importdata. I have a header line then several rows of data below it. ThenIi have another header line/row with the mean values below it. What would sugesst I use since importdata won't work?
R
Walter Roberson
on 9 Apr 2019
Rebecca, should only the "several rows of data" be read in, or should some of the information from after the first block be read in as well ?
More Answers (0)
See Also
Categories
Find more on Large Files and Big Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!