Why do I get different answers for inverse?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Matlab_DJ
am 15 Mär. 2017
Beantwortet: Carlos Felipe Rengifo
am 6 Jul. 2018
I'm not sure what's going on here. Same numbers, but using inv() gives me different answers than finding the inverse using adjoint over determinate.
clc;clear all;
syms s a
a = [ [0 1 0] ;
[-2 -4 1] ;
[0 0 6];];
matrix = s*eye(3) - a;
xs = inv(matrix) * [0;0;1;] *(1/(s+1))
pretty(xs)
b=adjoint(matrix);
c=det(matrix);
x2s = (b/c)* [0;0;1;] * (1/(s+1)) ;
pretty(x2s)
gives me
xs =
-1/((s + 1)*(- s^3 + 2*s^2 + 22*s + 12))
-s/((s + 1)*(- s^3 + 2*s^2 + 22*s + 12))
1/((s + 1)*(s - 6))
/ 1 \
| - --------------------------------- |
| 3 2 |
| (s + 1) (- s + 2 s + 22 s + 12) |
| |
| s |
| - --------------------------------- |
| 3 2 |
| (s + 1) (- s + 2 s + 22 s + 12) |
| |
| 1 |
| --------------- |
\ (s + 1) (s - 6) /
/ 1 \
| - --------------------------------- |
| 3 2 |
| (s + 1) (- s + 2 s + 22 s + 12) |
| |
| s |
| - --------------------------------- |
| 3 2 |
| (s + 1) (- s + 2 s + 22 s + 12) |
| |
| 2 |
| s + 4 s + 2 |
| - --------------------------------- |
| 3 2 |
\ (s + 1) (- s + 2 s + 22 s + 12) /
0 Kommentare
Akzeptierte Antwort
Carlos Felipe Rengifo
am 6 Jul. 2018
The variables "xs" and "x2s" contain equivalent mathematical expressions. The variable "xs" is a simplified version of the variable "x2s". You can verify this by writing the following sentence:
>> simplify(xs-x2s)
ans =
0
0
0
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Number Theory 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!