MATLAB for Python programmers

前端 未结 6 2025
没有蜡笔的小新
没有蜡笔的小新 2021-02-05 15:58

I\'ve used MATLAB on and off before, but I need to develop a good understanding of it now, and the language I\'m most familiar with is Python. Care to describe a MATLAB language

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 16:30

    1. MATLAB has superb documentation. In a world where everyone complains about how bad documentation X is, I think MATLAB's documentation contributes significantly to its popularity. Python's is good, too, but MATLAB's just feels a bit more immediately accessible. You can tell that Mathworks put some care into it.

    2. In MATLAB, the matrix is fundamental. If you do x = 3 in the workspace, you can then do matrix operations to x (as meaningless as that might be) such as transposition, inverse, eigendecomposition, etc. No casting is necessary. In Python/NumPy, you still need to convert arrays to matrices using scipy.matrix before doing matrix operations.

    3. I am not familiar with any explicit, popular MATLAB philosophy analogous to Python's zen (i.e., import this). But many characteristics are similar: easy experimentation, fast development time, easy to debug and profile, high level, extensible.

    4. MATLAB does not emphasize object orientation like Python. OO is still possible in MATLAB (e.g., classes are supported), but I don't know many people who make use of it.

    5. I like to think in the following way: NumPy is like the MATLAB core, SciPy is like the MATLAB toolboxes, Matplotlib lets you plot like MATLAB, and iPython is the MATLAB workspace.

    6. Oh yeah... MATLAB starts indexing with 1, not zero! This is a logical consequence of MATLAB's fundamental idea that every numeric "thing" is a matrix, and in linear algebra, matrices are often indexed starting with 1.

提交回复
热议问题