Commit 79bcebbb authored by tanakrit's avatar tanakrit

ส่งงาน week06

parent c2439df5
def Ab2Uc(A,b):
import numpy
A = numpy.array(A,float)
b = numpy.array(b,float)
n = len(b)
for j in range(0, n-1):
for i in range(j+1, n):
lam = A[i,j]/A[j,j]
A[i,j:n] = A[i, j:n] - lam*A[j, j:n]
b[i] = b[i] - lam*b[j]
print('U =',A)
print('c =',b)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment