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

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

[Octave-bug-tracker] [bug #46770] num2str produces different results in


From: Rik
Subject: [Octave-bug-tracker] [bug #46770] num2str produces different results in Octave and in Matlab
Date: Mon, 28 Dec 2015 17:55:13 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)

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

Copying over from stackoverflow.

The following code


x = [1.1, 2.22, -3.3; 4.44, 5.55, 6.6];
fmt = '%.16g ';
y = num2str(x, fmt)


produces different results in Matlab (R20105b)


y =
 1.1 2.22 -3.3
4.44 5.55  6.6


and in Octave (4.0.0)


y =
1.1 2.22 -3.3
4.44 5.55 6.6


The difference is the alignment: in Matlab the columns are right-aligned,
whereas in Octave they are not aligned.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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