# HG changeset patch # User Gunnar Farneback # Date 1287243325 -7200 # Node ID 52f95e3af7920f63f5f42c046a427ec2c244754c # Parent 030731a02f1076be656e5a33cc863241f82b2cd1 Check dimensions of XI and YI for cubic interpolation in the same way as for linear interpolation. diff -r 030731a02f10 -r 52f95e3af792 scripts/general/interp2.m --- a/scripts/general/interp2.m Sat Oct 16 16:08:12 2010 +0200 +++ b/scripts/general/interp2.m Sat Oct 16 17:35:25 2010 +0200 @@ -336,10 +336,10 @@ endif endif - ## Check dimensions of XI and YI - if (isvector (XI) && isvector (YI)) - XI = XI(:).'; - YI = YI(:); + ## If Xi and Yi are vectors of different orientation build a grid + if ((rows (XI) == 1 && columns (YI) == 1) + || (columns (XI) == 1 && rows (YI) == 1)) + [XI, YI] = meshgrid (XI, YI); elseif (! size_equal (XI, YI)) error ("interp2: XI and YI must be matrices of same size"); endif