octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39505] dlmwrite with coffset and roffset >0,


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #39505] dlmwrite with coffset and roffset >0, inserts extra characters
Date: Wed, 17 Jul 2013 21:25:38 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0 SeaMonkey/2.17.1

Follow-up Comment #11, bug #39505 (project octave):

(Trying again, my comment was cut off half-way....)

No I didn't read back in Octave, I just tried your original example in Octave
with double quotes around \t. That gave a beautiful text file with -seemingly-
empty lines - but read on.

Trying you original example in Matlab r2013b pre-release gives:


>>  a=[1 2 3 4 5;1 2 3 4 5;1 2 3 4 5]; >>
dlmwrite('matrix_text.txt',a,'-append','on','delimiter',
'\t','roffset',0,'coffset',0) Error using dlmwrite (line 113) Invalid
attribute tag: on


so your example doesn't work as-is in Matlab; 'append' is not a valid
user-configurable option in ML.

About your comment #4, did you literally try it in Matlab?
If I try (in ML r2013b pre-release): 


>> dlmwrite('matrix_text2.txt',a,'delimiter', ',','roffset',5,'coffset',0)


I get a text file looking like


,,,,
,,,,
,,,,
,,,,
,,,,
1,2,3,4,5
1,2,3,4,5
1,2,3,4,5


so your claim that ML writes empty lines corresponding to empty data rows in
case of printable characters doesn't hold water. Not even for non-printable
delimiters like tabs, my example in comment #5 gives the exact same results in
ML (but with single quotes around \t in the dlmwrite argument list).

As to your comment #7, I don't follow. Matlab says:


dlmread fills empty delimited fields with zero.


All in all I think you'd better re-read the docs.
I tend to close this bug with "invalid" but I'll await Jordi's and Rik's
opinions.

The "\t" versus '\t' thing is a different issue. Is this documented? If not it
may be worth another bug report.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39505>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]