Array programming: Difference between revisions

Content deleted Content added
m R: lang="rout"
Line 248:
 
If the system is overdetermined – so that <code>A</code> has more rows than columns – the pseudoinverse <code>A<sup>+</sup></code> (in MATLAB and GNU Octave languages: <code>pinv(A)</code>) can replace the inverse <code>A<sup>−1</sup></code>, as follows:
:<{{code>|2=matlab|1=pinv(A) *(A * x)==pinv(A) * (b)</code>}}
:<{{code>|2=matlab|1=(pinv(A) * A)* x ==pinv(A) * b</code>}} &nbsp; &nbsp; &nbsp; (matrix-multiplication associativity)
:<{{code>|2=matlab|1=x = pinv(A) * b</code>}}
 
However, these solutions are neither the most concise ones (e.g. still remains the need to notationally differentiate overdetermined systems) nor the most computationally efficient. The latter point is easy to understand when considering again the scalar equivalent <code>a * x = b</code>, for which the solution <code>x = a^-1 * b</code> would require two operations instead of the more efficient <code>x = b / a</code>.