MATLAB to Python Code conversion (NumPy, SciPy, MatplotLib?)

后端 未结 3 1124
青春惊慌失措
青春惊慌失措 2021-01-06 09:22

I\'m trying to convert the following code to Python from MATLAB for an EEG Project (partly because Python\'s slightly cheaper!)

Hopefully someone can point me in the

3条回答
  •  旧巷少年郎
    2021-01-06 09:54

    One small point - indexing between the two is different. If you just copy everything from MATLAB to Python, as you seem to have done, you'll be very very confused. MATLAB x(1:5:end) translates to Python x[0::5]. Go back to NumPy for MATLAB Users and scan down to the section called "Linear Algebra Equivalents" (about halfway down the page). It gives a dictionary of how to go back and forth.

提交回复
热议问题