Array division- translating from MATLAB to Python

前端 未结 5 854
我寻月下人不归
我寻月下人不归 2020-12-19 07:43

I have this line of code in MATLAB, written by someone else:

c=a.\'/b

I need to translate it into Python. a, b, and c are all arrays. The d

5条回答
  •  时光取名叫无心
    2020-12-19 08:29

    You can also approach this using the pseudo-inverse of B then post multiplying that result with A. Try using numpy.linalg.pinv then combine this with matrix multiplication via numpy.dot:

    c = numpy.dot(a, numpy.linalg.pinv(b))
    

提交回复
热议问题