help-octave
[Top][All Lists]
Advanced

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

permute doesn't delete singletons


From: Tom Holroyd
Subject: permute doesn't delete singletons
Date: Thu, 05 May 2005 12:38:55 -0400
User-agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324)

Hi.

Trailing singleton dimensions are automatically removed, right?  Like,

octave:67> x=zeros(10,3,1);
octave:68> size(x)
ans =

  10   3

But if I do:

octave:75> x=zeros(10,1,2);
octave:76> z=permute(x,[3,1,2]);
octave:77> size(z)
ans =

   2  10   1

I get a result with a trailing singleton dimension.  I'm porting some
MATLAB code that expects the result of permute above to be size 2 10,
which it is under MATLAB. Can permute be changed to remove the singleton dimension?
--
Dr. Tom Holroyd
"A man of genius makes no mistakes. His errors are volitional and
are the portals of discovery." -- James Joyce



-------------------------------------------------------------
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]