|
From: | Moritz Borgmann |
Subject: | Re: conv does not preverve orientation of input |
Date: | Fri, 28 Mar 2008 21:22:38 +0100 |
On 28-Mar-2008, Moritz Borgmann wrote: | In Octave, the orientation of the output of y = conv(a,b) is always a | row vector. In Matlab, the rules are the following: | | - if a is shorter or equal in size to b: orientation of y is the same as b | - if b is shorter than a: orientation of y is same as a. | | Wuut. You may or may not believe it, but there's code that depends on | this behavior. Why would this be desirable?
well, writing code that makes assumptions like this is of course not desirable. At least I wouldn't do it. In this case, I discovered code written by others, with fairly wide distribution, that failed in a very subtle manner because it expected Matlab behavior. In fact, it only assumed that the output orientation was the same as the orientation of a long input vector "b", where "a" was a short coefficient vector.
In a sense, Octave's behavior is also arbitrary (or am I overlooking some general practice that tells us to always return row vectors?). Considering this and given that there's no silver bullet, I figured it would be the least evil to support the mode of operation that code may expect from Matlab.
-M
[Prev in Thread] | Current Thread | [Next in Thread] |