def matrix_to_vector(matrix, system):
 outvec = Vector.zero
 vects = system.base_vectors()
 for (i, x) in enumerate(matrix):
  outvec += (x * vects[i])
 return outvec

def matrix_to_vector ( matrix , system ) : outvec = Vector . zero vects = system . base_vectors ( ) for ( i , x ) in enumerate ( matrix ) : outvec += ( x * vects [ i ] ) return outvec
converts a vector in matrix form to a vector instance .