How to solve this matrix using inverse function?

I want to use the inverse function (inv) on this 10 x 10 matrix but I keep getting all this Inf in place of the numbers.
The matrix goes as follows,
clc,clear all
a = [1 2 3 4 5 6 7 8 9 10];
b = [21 22 23 24 25 26 27 28 29 30];
c = [11 12 13 14 15 16 17 18 19 20];
d = [31 32 33 34 35 36 37 38 39 40];
f = [41 42 43 44 45 46 47 48 49 50];
g = [61 62 63 64 65 66 67 68 69 70];
h = [51 52 53 54 55 56 57 58 59 60];
i = [81 82 83 84 85 86 87 88 89 90];
j = [91 92 93 94 95 96 97 98 99 100];
e = [1 2 3 4 5 6 7 8 9 10];
aa = sum(a);
bb = sum(b);
cc = sum(c);
dd = sum(d);
ff = sum(f);
gg = sum(g);
hh = sum(h);
ii = sum(i);
jj = sum(j);
ee = sum(e);
AA = [a ;b ;c ;d ;e ;f ;g ;h ;i ;j];
b = [aa ;bb ;cc ;dd ;ff ;gg ;hh ;ii ;jj ;ee];
Res = inv(A)
The result I am getting is this one,
Warning: Matrix is singular to working precision.
> In borrame at 39
Res =
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Why if the command (inv) not working? Please help.

 채택된 답변

James Tursa
James Tursa 2013년 3월 15일

1 개 추천

Assuming inv(A) is a typo and you really meant inv(AA):
"a" and "e" are the same, so you have two rows in AA that are the same. This linear dependency creates a singular matrix AA.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

질문:

2013년 3월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by