Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #33316
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2012-11-14 01:04 -0800 |
| References | <98b451e1-5cd5-46e9-8be4-59dcc835700b@googlegroups.com> |
| Message-ID | <8a13e8d2-1dec-441a-85fe-19ba7a61d1a0@googlegroups.com> (permalink) |
| Subject | Re: Division matrix |
| From | wxjmfauth@gmail.com |
Le mardi 13 novembre 2012 02:00:28 UTC+1, Cleuson Alves a écrit : > Hello, I need to solve an exercise follows, first calculate the inverse matrix and then multiply the first matrix. > > I await help. > > Thank you. > > follows the code below incomplete. > > > > m = [[1,2,3],[4,5,6],[7,8,9]] > > x = [] > > for i in [0,1,2]: > > y = [] > > for linha in m: > > y.append(linha[i]) > > x.append(y) > > > > print x > > [[1, 4, 7], [2, 5, 8], [3, 6, 9]] > > > > def ProdMatrix(x,b): > > tamL = len(x) > > tamC = len(x[0]) > > c = nullMatrix(tamL,tamC) > > for i in range(tamL): > > for j in range(tamC): > > val = 0 > > for k in range(len(b)): > > val = val + x[i][l]*b[k][j] > > c[i][j] > > return c ------ Pedagogical hint: Before blindly calculating the inverse matrix, it may be a good idea to know if the inverse matrix exists. jmf
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Division matrix Cleuson Alves <cleuson.o@gmail.com> - 2012-11-12 17:00 -0800 Re: Division matrix Ian Kelly <ian.g.kelly@gmail.com> - 2012-11-12 18:25 -0700 Re: Division matrix Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-13 13:48 -0500 Re: Division matrix "R. Michael Weylandt" <michael.weylandt@gmail.com> - 2012-11-13 22:14 +0000 Re: Division matrix wxjmfauth@gmail.com - 2012-11-14 01:04 -0800
csiph-web