octave-maintainers
[Top][All Lists]
Advanced

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

rotdim


From: John W. Eaton
Subject: rotdim
Date: Sat, 16 Jul 2011 13:09:41 -0400

While writing tests for rotdim, I noticed the following behavior,
which I find a little strange:

  > rotdim ([1;2], 1)
  ans =

     2
     1

  > rotdim ([1;2], 2)
  ans =

     1
     2

  > rotdim ([1;2], 3)
  ans =

     2
     1

  > rotdim ([1;2], 4)
  ans =

     1

Compare with what happens with a row vector:

  > rotdim ([1,2], 1)
  ans =

     2
     1

  > rotdim ([1,2], 2)
  ans =

     2   1

  > rotdim ([1,2], 3)
  ans =

     1
     2

  > rotdim ([1,2], 4)
  ans =

     1   2


This seems to be due to the way rotdim is looking at singleton
dimensions.  Normally, it seems that Octave would not skip singleton
dimensions if they are in the first two dimensions.  Should I change
rotdim so that it will only skip leading singleton dimensions if the
matrix argument has more than two dimensions?  That seems like the
least surprising behavior to me, but maybe there is some good reason
for the way things work now that I'm not seeing.

jwe


reply via email to

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