Matrix Inversion Process Help

3 ビュー (過去 30 日間)
Taner Cokyasar
Taner Cokyasar 2016 年 2 月 12 日
コメント済み: Walter Roberson 2016 年 2 月 13 日
How can I see the operations of a matrix inversion on Matlab? For example, I am trying to find the inverse of a 3x3 matrix. How can I see the steps of [A | I] >>> Elementary Row Operations>>> [I | A^(-1)] ?
Besides, Is there any way to make Matlab do all the calculations in fractional numbers, instead of e.g. 0.2 ?

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 2 月 12 日
To have the calculations done as fractions, use the Symboblic Toolbox
  2 件のコメント
Taner Cokyasar
Taner Cokyasar 2016 年 2 月 12 日
I am a new user. Could you please explain a little bit more where this Symbolic Toolbox is and how to use it by a simple example, if possible?
Thanks
Walter Roberson
Walter Roberson 2016 年 2 月 13 日
If you have the Student Version license that includes Symbolic Toolbox, and have installed the toolbox, then
sym('1/2') + sym('1/3')
would be sym('5/6') which would display as 5/6
If you have an expression such as
syms A B C
expr = (A^2+B)/C
subs(expr, {A, B, C}, {4, 3, 7})
would give you sym('19/7') which would display as 19/7
However, if you were to use
(4^2+3)/7
then you would get the nearest floating point equivalent to 19/7, 2.71428571428571441259691710001789033412933349609375 which is 3056014032858551/1125899906842624 rather than 19/7
Now compare
M = [1 2 3; 4 5 6; 7 8 10];
inv(M)
inv(sym(M))

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNumber Theory についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by