solving linear equations in a loop
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
The documentation for inv says:
A frequent misuse of inv arises when solving the system of linear equations Ax = b. One way to solve this is with x = inv(A)*b. A better way, from both an execution time and numerical accuracy standpoint, is to use the matrix division operator x = A\b.
The above taken for granted, is it nevertheless reasonable to precalculate invA = inv(A) in front of a loop containing (A\Xi), especially one that necessarily sequential?
0 Kommentare
Akzeptierte Antwort
Matt J
am 21 Mär. 2014
Bearbeitet: Matt J
am 21 Mär. 2014
No. Make the different Xi the columns of matrix, X and just do A\X.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!