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 18:09:55 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)

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

Second incompatibility regards how to apply the format string to N-d arrays. 
Copying from Stack Overflow report again.

Another difference is how multidimensional arrays are treated. For example,


x = cat(3, magic(3), -magic(3));
fmt = '%.16g ';
y = num2str(x, fmt)


produces in Matlab


y =
8  1  6 -8 -1 -6
3  5  7 -3 -5 -7
4  9  2 -4 -9 -2


and in Octave


y =

8 1 6
3 5 7
4 9 2
-8 -1 -6
-3 -5 -7
-4 -9 -2


That is, Matlab attaches the 3D slices along the second dimension, and Octave
along the first.


    _______________________________________________________

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]