Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
def MatrixSubstitutor(SymbolicMatrix,ValueMatrix, Expression,n):
    #create dict
    SubstitutionDict = dict([(SymbolicMatrix[p//n][p%n],ValueMatrix[p//n][p%n]) for p in range(n^2)])
    return Expression.subs(SubstitutionDict) #yay
#for example,
print MatrixSubstitutor(S,FPList[1],dSdl,n)
# in the words of apache2 - yay! it works!!

@DSM - thanks for all that help!