From Scanty Lemur, 11 Months ago, written in Python.
Embed
  1. iterations = 100
  2. matFileName = 'm.txt'
  3. import numpy
  4.  
  5. f = open(matFileName, 'r')
  6. a = []
  7. for i in f:
  8.   b = []
  9.   for j in i.split():
  10.     b.append(float(j))
  11.   a.append(b)
  12. f.close()
  13.  
  14.  
  15. m = numpy.array(a, dtype='float64')
  16. c_a = [0, 0, 0, 10, 0, 0, 0]
  17. c = numpy.transpose(numpy.array(c_a, dtype='float64'))
  18. d_a = [-1, -1, -1, -1, -1, -1, -1]
  19. d = numpy.array(d_a, dtype='float64')
  20.  
  21. i = 0
  22. while i < iterations:
  23.   d = numpy.matmul(m, c)
  24.   c = d
  25.   i += 1
  26. print(d)
  27.