用python替换Matlab [英] replacing Matlab with python

查看:85
本文介绍了用python替换Matlab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名工程专业的学生,​​我必须做大量的数值处理,绘图,模拟等工作.我目前使用的工具是Matlab.我在大学计算机上使用它来完成大部分任务.但是,我想知道有哪些可用的免费选项.

我已经做过一些研究,许多人说python在各种情况下都可以替代matlab.我想知道如何用python做所有这些事情.我使用的是Mac,如何安装不同的python软件包.那些包是什么?这真的是可行的选择吗?使用此python设置我可以做什么和不能做什么?

解决方案

在Mac上,最简单的入门方法是(无特定顺序):

  • Python发行版,其中包括您可能需要的大多数科学软件包.免费用于学术/非商业用途.
  • Macports -是最新版本,因此sudo port install py26-numpy py26-scipy py26-matplotlib py26-ipython应该可以帮助您入门. li>
  • Scipy Superpack -用于安装所有重要软件包的最新svn版本的脚本.

大约2年前,我已经做到了这一点(用Python替换了Matlab),并且没有回头.使用Python进行广播,更直观的内存模型和Numpy的其他优点使数值工作变得非常愉快.与f2py和cython一起使用,可以很容易地将内部循环放入另一种语言中. 这是一个不错的起点-其他令人振奋的页面是 ParallelProgramming .一定要了解Python的变量是对对象的引用"的语义……在进行了这种调整之后,一切都是一帆风顺的.击败matlab的最酷的事情之一是我在8个内核上运行了2条线... p = Pool(8); res = p.map(analysis_function,list_of_data)-MATLAB并行工具箱是如此昂贵,以至于我还没有看到实际上拥有它们的大学.

i am a engineering student and i have to do a lot of numerical processing, plots, simulations etc. The tool that i use currently is Matlab. I use it in my university computers for most of my assignments. However, i want to know what are the free options available.

i have done some research and many have said that python is a worthy replacement for matlab in various scenarios. i want to know how to do all this with python. i am using a mac so how do i install the different python packages. what are those packages? is it really a viable alternative? what are the things i can and cannot do using this python setup?

解决方案

On a Mac the easiest ways to get started are (in no particular order):

  • Enthought Python Distribution which includes most scientific packages you are likely to need. Free for academic/non-commercial use.
  • Macports - up to date with latest releases, so sudo port install py26-numpy py26-scipy py26-matplotlib py26-ipython should get you started.
  • Scipy Superpack - script to install recent svn versions of all the important packages.

I've done exactly this (replace Matlab with Python) about 2 years ago and haven't looked back. The broadcasting in Python, more intuitive memory model and other Numpy advantages make numerical work a complete pleasure. Plus with f2py, cython it is incredibly easy to put inner loops in another language. This is a good place to start - other impressive pages to provide motiviation are PerformancePython and ParallelProgramming. Be sure to understand Pythons "variable is a reference to an object" semantics... after that adjustment everything is plain sailing. One of the coolest things that beats matlab is in 2 lines I run over 8 cores... p = Pool(8); res = p.map(analysis_function,list_of_data) - MATLAB parallels toolboxes are so expensive I've yet to see a University that actually has them.

这篇关于用python替换Matlab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆