help-octave
[Top][All Lists]
Advanced

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

shiftdim.m documentation vs. reality


From: Joshua Rigler
Subject: shiftdim.m documentation vs. reality
Date: Tue, 15 Nov 2005 16:58:53 -0600

I'm posting here, instead of the bug-octave list, because it is very
possible that I simply do not understand how shiftdim.m is *supposed* to
work.  If this is a bug, either in documentation or in implementation, I
beg your pardon, and request that a regular Octave maintainer move this
message to the bug-octave list.

The documentation in 2.1.71 says that a negative integer argument to
shiftdim.m will move dimensions to the left, cycling the 1st dimension
to the end.  A positive integer argument will shift all dimensions to
the right, and add a singleton first dimension.  This seems to be the
opposite of what I observe, and what's more, it seems to be what is
recommended in this post from 2004:


  http://www.octave.org/octave-lists/archive/bug-octave.2004/msg00007.html


I want to change from

   size(x) == [10 1 2]  ...to...  size(x) == [1 10 2]

so I figure I should do something like

   x = shiftdim(squeeze(x),-1);

but I want to be certain that this functionality will be constant in the
future.  Any comments or suggestions?

-EJR



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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