[bug #68531] mldivide for non-square matrix

Liang Tang <[email protected]> Thu, 16 Jul 2026 11:51:36 -0400 (EDT)
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
--===============1298512361811641856==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

UGxlYXNlIHVzZSB0aGUgYnVnIHRyYWNrZXIgdG8gcG9zdCB1cGRhdGVzIHRvIGEgYnVnIHJlcG9y
dC4gIFRoZSBtYWlsaW5nIGxpc3QgaXMgaW50ZW5kZWQgYXMgYSByZWFkLW9ubHkgbm90aWZpY2F0
aW9uIHN0cmVhbS4gIEluZm8gcG9zdGVkIHRvIHRoaXMgbWFpbGluZyBsaXN0IGFkZHJlc3Mgd29u
J3QgYXBwZWFyIGluIHRoZSB0cmFja2VyIGRhdGFiYXNlIHdoZXJlIGl0IGlzIG1vc3QgdXNlZnVs
LgoK

--===============1298512361811641856==
Content-Type: MULTIPART/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; BOUNDARY="8323329-1714636915-1784217096=:1393533"
Content-Disposition: inline

--8323329-1714636915-1784217096=:1393533
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

URL:=0A  <https://savannah.gnu.org/bugs/?68531>=0A=0A                 Summa=
ry: mldivide for non-square matrix=0A                   Group: GNU Octave=
=0A               Submitter: lt1234=0A               Submitted: Thu 16 Jul =
2026 03:51:33 PM UTC=0A                Category: Octave Function=0A        =
        Severity: 3 - Normal=0A                Priority: 5 - Normal=0A     =
         Item Group: Documentation=0A                  Status: None=0A     =
        Assigned to: None=0A         Originator Name: lt1234=0A        Orig=
inator Email:=0A             Open/Closed: Open=0A         Discussion Lock: =
Unlocked=0A                 Release: 11.1.0=0A        Operating System: Mic=
rosoft Windows=0A           Fixed Release: None=0A         Planned Release:=
 None=0A=0A=0A    _______________________________________________________=
=0A=0AFollow-up Comments:=0A=0A=0A-----------------------------------------=
--------------=0ADate: Thu 16 Jul 2026 03:51:33 PM UTC By: Liang Tang <lt12=
34>=0AI believe that this observation is well known.  But I could not ident=
ify any=0Adocument explicitly calls out the difference.  So I am using the =
bug report to=0Adocument.  Thanks. =0A=0AFor mldivide with a non-square mat=
rix, we have =0A=0AOctave =0AIf the system is not square, or if the coeffic=
ient matrix is=0Asingular, a minimum norm solution is computed.=0A=0AMatlab=
=0AIf A is a rectangular m-by-n matrix with m ~=3D n, and B is a matrix wit=
h m=0Arows, then A\B returns a least-squares solution to the system of equa=
tions=0AA*x=3D B. x may not be the minimum-norm solution.    =0A=0AExample:=
 =0AA =3D [1 2 0; 0 4 3];=0Ab =3D [8; 18];=0Ax =3D A\b=0A=0AOctave =0A   0.=
9180=0A   3.5410=0A   1.2787=0AMatlab (see online documentation)   =0A    0=
=0A    4.0000=0A    0.6667=0A    =0AMatlab lsqminnorm outputs the Octave so=
lution above.  (see matlab lsqminnorm=0Aonline documentation figure) =0AX =
=3D lsqminnorm(A,b)=0A=0A=0A=0A=0A=0A=0A=0A=0A    _________________________=
______________________________=0A=0AReply to this item at:=0A=0A  <https://=
savannah.gnu.org/bugs/?68531>=0A=0A________________________________________=
_______=0AMessage sent via Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-1714636915-1784217096=:1393533
Content-Type: APPLICATION/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCalj+CAAKCRCqLAuaBUf3
Tgs5AQD2OIF3/bPSdTF76uvYn3wFQ1cK7m7fBIvOb/LGiYxdMAD/U4sBNrkd9ajF
kKEANe10OXKpIk9lDQ+oQ/UmScDdcgM=
=Xcmn
-----END PGP SIGNATURE-----

--8323329-1714636915-1784217096=:1393533--



--===============1298512361811641856==--