octave-maintainers
[Top][All Lists]
Advanced

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

Re: Proposed enhancement for vec()


From: Michael D Godfrey
Subject: Re: Proposed enhancement for vec()
Date: Fri, 17 Dec 2010 08:55:43 -0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7

On 12/17/2010 07:57 AM, Judd Storrs wrote:
size(vec(x,5)) == [1 1 1 1 numel(x)] == shiftdim(x(:),-4) ==
reshape(x,[1 1 1 1 numel(x)])

I'm not aware of a simple way to do this otherwise or generically
(e.g. in a wrapper function for ifft(x,n,dim) where a shift vector
should be applied along the desired dimension). vec() is an octave
extension that does not exist in Matlab, so compatibility is not an
issue. The primary benefit is improved semantics -- vec(x,10) is more
semantically direct than the reshape(...), shiftdim(...) constructs.


--judd
Very good.  I have looked for a clean way to do this too. 

Thanks,
Michael


reply via email to

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