dlmwrite error: Skipping lines, adding garbage values

2 views (last 30 days)
I have a 455x39 array that I need to append to a text file. When I'm using dlmwrite,
dlmwrite(fileName, arrayName,'delimiter',\t,'-append');
it gives me 454 rows, with an additional garbage row above it. If I use the same command to write this array to a new file, it works correctly. What is going wrong?
  4 Comments
Kosha Dholakia
Kosha Dholakia on 23 Mar 2015
So that's my m file for that particular function and the raw data. I did fprintf in the end and solved the issue, but dlmwrite, the way suggested by you gives me an error.
Anyway, the problem is solved with fprintf. Thank you.
Image Analyst
Image Analyst on 23 Mar 2015
The way I suggested works just fine - I tried it several times. You must have used it improperly. If you still want to use the dlmwrite() method or want to know what the error message was about, then give your code for it.

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 20 Mar 2015
This works fine for me
arrayName = randi(9, 455, 39);
dlmwrite('deleteme.txt', arrayName, 'delimiter','\t','-append');
though I did have to add single quotes around your \t. I ran it twice and there is no garbage row at line 456, between the two sets of data.

More Answers (0)

Categories

Find more on Data Import and Export 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!