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: Rik
Subject: [Octave-bug-tracker] [bug #39505] dlmwrite with coffset and roffset >0, inserts extra characters
Date: Wed, 17 Jul 2013 18:41:09 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0

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

Bug was re-opened.  What is the actual problem?  dlmwrite seems to be
respecting the documentation regarding inserting delimiters if roffset or
coffset is used.  The Mathworks documentation is here
(http://www.mathworks.com/help/matlab/ref/dlmwrite.html).

I changed the sample code to use a comma as the delimiter so that I can see
what is going on.


a=[1 2 3 4 5;1 2 3 4 5;1 2 3 4 5];

dlmwrite('matrix_text.txt',a,'-append','on','delimiter',
',','roffset',0,'coffset',0);

b=[2 3 4 5 6;2 3 4 5 6;2 3 4 5 6];

dlmwrite('matrix_text.txt',b,'-append','on','delimiter',
',','roffset',0,'coffset',0);

dlmwrite('matrix_text.txt',a,'-append','on','delimiter',
',','roffset',1,'coffset',0);

dlmwrite('matrix_text.txt',a,'-append','on','delimiter',
',','roffset',2,'coffset',0);

dlmwrite('matrix_text.txt',a,'-append','on','delimiter',
',','newline','unix','roffset',3,'coffset',0);

dlmwrite('matrix_text.txt',a,'-append','on','delimiter',
',','newline','unix','roffset',4,'coffset',3); 



If I then read the file back in with dlmread all of the test matrices are in
their proper positions.

"z

x = dlmread ('matrix_text.txt', ',')
x =

   1   2   3   4   5   0   0   0
   1   2   3   4   5   0   0   0
   1   2   3   4   5   0   0   0
   2   3   4   5   6   0   0   0
   2   3   4   5   6   0   0   0
   2   3   4   5   6   0   0   0
   0   0   0   0   0   0   0   0
   1   2   3   4   5   0   0   0
   1   2   3   4   5   0   0   0
   1   2   3   4   5   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   1   2   3   4   5   0   0   0
   1   2   3   4   5   0   0   0
   1   2   3   4   5   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   1   2   3   4   5   0   0   0
   1   2   3   4   5   0   0   0
   1   2   3   4   5   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   1   2   3   4   5
   0   0   0   1   2   3   4   5
   0   0   0   1   2   3   4   5


I'm attaching the actual file generated as matrix_text.octave.txt.  If you
have access to Matlab you could run the code in this comment and compare the
generated file to matrix_text.octave.txt.  If there is a difference then we
can look into it, but Octave appears to be following the documentation
correctly.


(file #28606)
    _______________________________________________________

Additional Item Attachment:

File name: matrix_text.octave.txt         Size:0 KB


    _______________________________________________________

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]