Your comments

Thanks for your help. But I think the following matlab code is more convenient (It is in the lu page of matlab document):

dA = decomposition(A,'lu');
x = dA\b

What do you think of it?