Array division- translating from MATLAB to Python

前端 未结 5 866
我寻月下人不归
我寻月下人不归 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:20

    [edited] As Suvesh pointed out, i was completely wrong before. however, numpy can still easily do the procedure he gives in his post:

    A = numpy.matrix(numpy.random.random((18, 1))) # as noted by others, your dimensions are off
    B = numpy.matrix(numpy.random.random((25, 18)))
    C = A.T * B.T * (B * B.T).I
    

提交回复
热议问题