[bug #48564] Octave does not accept "1 / ND array", "mrdivide (1, ND array)", "mldivide (ND array, 1)"
Nicholas Jankowski <[email protected]>
| Newsgroups | gmane.comp.gnu.octave.bugs |
|---|---|
| Message-ID | <[email protected]> |
Please use the bug tracker to post updates to a bug report. The mailing list is intended as a read-only notification stream. Info posted to this mailing list address won't appear in the tracker database where it is most useful.
Follow-up Comment #17, bug #48564 (group octave):
generally identical behavior for mldivide:
x = A\B solves the system of linear equations A*x = B. The matrices A and B
must have the same number of rows. MATLAB® displays a warning message if A is
badly scaled or nearly singular, but performs the calculation regardless.
If A is a scalar, then A\B is equivalent to A.\B.
If A is a square n-by-n matrix and B is a matrix with n rows, then x = A\B is
a solution to the equation A*x = B, if it exists.
If A is a rectangular m-by-n matrix with m ~= n, and B is a matrix with m
rows, then A\B returns a least-squares solution to the system of equations
A*x= B. x may not be the minimum-norm solution.
>> rand(1,3)\9
ans =
9.5221
0
0
>> rand(3,1)\9
Error using \
Matrix dimensions must agree.
>> rand(2,2)\9
Error using \
Matrix dimensions must agree.
>> rand(2,4)\9
Error using \
Matrix dimensions must agree.
>> rand(4,2)\9
Error using \
Matrix dimensions must agree.
>> rand(3,3)\9
Error using \
Matrix dimensions must agree.
>> rand(3,3,3)\9
ans(:,:,1) =
82.0438 20.0726 14.3336
141.5286 24.6025 11.6583
22.2453 11.7877 9.6478
ans(:,:,2) =
9.2522 12.9261 16.9701
46.8681 95.9283 10.4513
64.8069 17.1297 18.5623
ans(:,:,3) =
22.8742 17.3059 15.3559
13.4042 25.8834 34.3321
12.1415 60.0011 202.4561
>> rand(3,2,1)\9
Error using \
Matrix dimensions must agree.
>> rand(3,0,1)\9
Error using \
Matrix dimensions must agree.
>> rand(3,0,2)\9
ans =
3×0×2 empty double array
>> rand(3,2,0)\9
ans =
3×2×0 empty double array
>> rand(3,1,0)\9
ans =
3×1×0 empty double array
and in octave:
octave:16> rand(1,3)\9
ans =
8.9070
3.3178
5.0056
octave:17> rand(2)\9
error: operator \: nonconformant arguments (op1 is 2x2, op2 is 1x1)
octave:18> rand(2,4)\9
error: operator \: nonconformant arguments (op1 is 2x4, op2 is 1x1)
octave:19> rand(4,2)\9
error: operator \: nonconformant arguments (op1 is 4x2, op2 is 1x1)
octave:20> rand(3)\9
error: operator \: nonconformant arguments (op1 is 3x3, op2 is 1x1)
octave:21> rand(3,3,3)\9
error: operator \: nonconformant arguments (op1 is 3x9, op2 is 1x1)
octave:22> rand(3,2,1)\9
error: operator \: nonconformant arguments (op1 is 3x2, op2 is 1x1)
octave:23> rand(3,0,1)\9
error: operator \: nonconformant arguments (op1 is 3x0, op2 is 1x1)
octave:24> rand(3,0,2)\9
error: operator \: nonconformant arguments (op1 is 3x0, op2 is 1x1)
octave:25> rand(3,2,0)\9
error: operator \: nonconformant arguments (op1 is 3x0, op2 is 1x1)
octave:26> rand(3,1,0)\9
error: operator \: nonconformant arguments (op1 is 3x0, op2 is 1x1)
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?48564>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaZYkegAKCRCqLAuaBUf3 To9jAQDBdiEFipLfBYLa3DLRtO+wEgoS+XQOsVu99wwNdsW22QEAlAQDY5kCqILy 4ElQMM3Aa3aP3oO4+6p3syhqDqDigQI= =UbBr -----END PGP SIGNATURE-----