MATLAB for Python programmers

前端 未结 6 2037
没有蜡笔的小新
没有蜡笔的小新 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条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 16:36

    You can't do indexing on function result directly;

    from numpy import *
    sin(array(range(10))*pi/10)[3]
    

    It doesn't work in MATLAB; you need to save the result first:

    x = sin(0:pi/10:pi)
    x(3)
    

    This is from Jonas's tutorial.

提交回复
热议问题