(
Jump to the original submission)
Mon 07 Nov 2016 12:44:03 AM UTC, comment #7:
I checked something in along the lines that Nir suggested (http://hg.savannah.gnu.org/hgweb/octave/rev/125391edc71b). Fixed, closing report.
|
Sun 06 Nov 2016 11:47:22 AM UTC, comment #6:
Senseless undocumented Matlab behavior.
As a work-around, we can replace line 228 in scripts/general/interp2.m
with
Then we can check that
|
Sun 06 Nov 2016 02:57:35 AM UTC, comment #5:
I asked on the Octave Maintainer's list and the behavior of indexing with a vector is required for Matlab compatibility.
|
Wed 02 Nov 2016 03:28:35 PM UTC, comment #4:
Is this something we are following for Matlab compatibility? For scalars or matrices, the resulting value after indexing has the size of the idx vector. It is only when a vector is indexed by another vector that the result follows the original vector's size.
Matlab test
|
Wed 02 Nov 2016 12:40:37 PM UTC, comment #3:
The problem is caused by how vector indexing is working in Octave. If a is 2x1, while idx is 1x2, is there any reason that a(idx) is 2x1? Seems like it should be 1x2. (If a was a matrix instead of a vector, a(idx) would indeed be 1x2.)
|
Tue 01 Nov 2016 09:38:08 PM UTC, comment #2:
The problem is in the final line of the "linear" method.
At this point the factors a, b, c, d are all column vectors (2x1), while Xsc and Ysc are row vectors (1x2). The multiplication steps broadcast automatically to create 2x2 final matrices.
I don't know what the best way to resolve this is.
|
Tue 01 Nov 2016 06:04:27 PM UTC, comment #1:
Confirmed. Maybe something with automatic broadcasting is going on.
|
Tue 01 Nov 2016 02:04:45 PM UTC, original submission:
try
and you get
ans =
3 4
3 4
With any other method one gets the correct result [3 4].
|
(Note: upload size limit is set to 16384 kB, after insertion of the required
escape characters.)
Attach File(s):
Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Follow 3 latest changes.