I was converting LU decomposition matlab code into python.
But while I was doing it I encountered with this error
'numpy.ndarray' object is not callable
this error occurs when I tried to test my code. Here is my code and can anyone help with this problem?? I'm waiting for your help.
import numpy as np
def LU(a):
[m,m]=a.shape
for k in range(0,m-1,1):
a[k+1:m-1,k]=a[k+1:m-1,k]/a(k,k)
a[k+1:m-1,k+1:m-1]=a[k+1:m-1,k+1:m-1]-a[k+1:m-1,k]*a[k,k+1:m-1]
L=np.eye(m,m)+np.tril(a,-1)
U=np.triu(a)
return [L,U]
b=np.array([[1,0,0],[0,1,0],[0,0,1]])
LU(b)
a(k,k)).