From bug-request at octave dot org Sat Jul 16 14:13:52 2005 Subject: conv.m compatibility From: cctsim To: bug at octave dot org Date: Sat, 16 Jul 2005 20:12:40 +0100 (BST) Description: conv.m is not compatible with matlab. In matlab b controls whether y is a column or row vector. Example (matlab): >> a=ones(1,5); >> b=ones(1,5); >> size(conv(a,b)) ans = 1 9 >> size(conv(a.',b)) ans = 1 9 >> size(conv(a,b.')) ans = 9 1 In octave y is always a row vector. Possible patch: --- conv.m.orig 2005-07-06 23:21:30.001000000 +0100 +++ conv.m 2005-07-16 19:52:54.421875000 +0100 at @ -52,8 +52,10 @@ if (rows (a) > 1) a = reshape (a, 1, la); endif + bc=0; if (rows (b) > 1) b = reshape (b, 1, lb); + bc=1; ## Flag that b is a column vector endif ## Use the shortest vector as the coefficent vector to filter. at @ -73,4 +75,9 @@ y = filter (b, 1, x); endif + ## Compatibility + if (bc==1) + y=y.'; + endif + endfunction Best Regards cctsim ___________________________________________________________ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com ------------------------------------------------------------- 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 -------------------------------------------------------------