R
R
Realen2021-07-15 13:10:10
Python
Realen, 2021-07-15 13:10:10

How to adapt matlab code to python?

Tell me please. Matlab code:

C = Ye'*Ye / (N-M+1);
[RHO,LAMBDA] = eig(C);

Python code:

С = np.dot(Ye.T, Ye) / (N-M+1)
lamdba, rho = LA.eig(C)

Dimension Ye 491x10, N 500, M 10
I used dot and matmul methods. But the dimension of C in matlab is 10x10, and in python it is 491x10. Tell me, please, what to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2021-07-15
@res2001

Tell me, please, what to do?

Read the documentation on the functions and operations used, look for differences and bring the python code to a working state.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question