(
Jump to the original submission)
Thu 15 Dec 2016 11:18:05 AM UTC, comment #6:
see also bug #41441 .
|
Sat 19 Nov 2016 08:24:38 PM UTC, comment #5:
These issues are still all present in Octave 4.2.0.
|
Sat 11 Jul 2015 03:50:15 AM UTC, comment #4:
This is still an issue in version 4.0.0.
It is easy to work around by placing the diagonal matrix in [...]:
> [eye(2)] + [1 0]
ans =
2 0
1 1
However, that is not done in some library routines (I was bitten by mvnrnd.m) and so Matlab-compliant user code that does not rely on automatic broadcasting can be affected. The bug has been open for three years; is it time to rewrite all library routines to work around it?
Another surprising twist is that a slice of a diagonal matrix is still considered "diagonal".
> a = eye(2);
> b = a(1,:)
b =
Diagonal Matrix
1 0
> b + [1; 0]
error: operator +: nonconformant arguments (op1 is 1x2, op2 is 2x1)
|
Sun 21 Sep 2014 10:32:30 AM UTC, comment #3:
I encountered something similar with automatic broadcasting and sparse vectors:
ones(3,10).*[0;2;0] # works as expected
ones(3,10).*sparse(2,1,2,3,1) # does not work
and yields the following error message:
error: product: nonconformant arguments (op1 is 3x10, op2 is 3x1)
I am on version 3.8.1
|
Sun 19 Jan 2014 10:35:43 PM UTC, comment #2:
Still present on the current development version of Octave (hg rev c1baf94184af):
|
Sun 11 Mar 2012 07:25:38 AM UTC, comment #1:
Hm, I guess I missed a few cases with the diagonal matrices. I'll look into it.
|
Sun 11 Mar 2012 06:39:16 AM UTC, original submission:
I think broadcasting should work like #12, but #10 gives error.
10> eye(4) .- (1:4)'
error: operator -: nonconformant arguments (op1 is 4x4, op2 is 4x1)
11> eye(4) .* (1:4)'
warning: product: automatic broadcasting operation applied
ans =
1 0 0 0
0 2 0 0
0 0 3 0
0 0 0 4
12> eye(4) .- repmat((1:4)',1,4)
ans =
0 -1 -1 -1
-2 -1 -2 -2
-3 -3 -2 -3
-4 -4 -4 -3
13> version
ans = 3.6.1-rc0
|
(Note: upload size limit is set to 16384 kB, after insertion of the required
escape characters.)
Attach File(s):
Comment:
No files currently attached
Follow 9 latest changes.