Assignment #5
A is a square matrix (10×10), hence det(A) is defined and equals 0, which means that A is unique (not invertible). det(A) = 0, solve(A) properly gives a solitary system error (there is no inverse).
Why operations on B fail (non‑square matrix).
B is not a square (10×100). Inverse and determinants are only defined for square matrices, therefore both calls are wrong by definition.
A determinant close to 0 means (almost) singularity and computations that aren't stable.
It's better to use solution(A, b) (or qr.solve/SVD) to solve systems than to make an explicit inverse; it's more reliable and quicker.
Comments
Post a Comment