Octave和MATLAB之间的区别? [英] Differences between Octave and MATLAB?

查看:598
本文介绍了Octave和MATLAB之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一位了解Python,Ruby和一些C的程序员,他们正试图决定学习GNU Octave还是Matlab.我知道他们有很多共同的 ,但是我不清楚如何类似的语法甚至是数据结构.每个人都说它们相似",但是没有人说它们实际上有多相似.上面的链接显示了几个在语法上相似或相同的示例,这对整个语言都是正确的吗?

I'm a programmer who knows Python, Ruby and some C who is trying to decide whether to learn GNU Octave or Matlab. I know that they have a lot in common, but it isn't clear to me how similar the syntax is or even the data structures are. Everyone says they are "similar", but no one says how similar they actually are. The above link shows several examples where they are syntactically similar or identical, is this true for the whole language?

我正在尝试学习通用语言,以进行更多的科学计算,可能使用一些图像分析库.我知道我可以编程使用许多其他语言,但是我的顾问说,了解MATLAB或Octave在科学中至关重要.

I am trying to learn the language in general to do more scientific computing, possibly using some image analysis libraries. I know there are plenty of other languages I could program in, but my advisors say that knowing MATLAB or Octave is crucial in the sciences.

此外,Matlab值得吗?我没有很多钱,但是如果图书馆或其他地方有重要区别,我相信我会找到钱的.

Additionally, is Matlab worth the cost? I don't have a lot of money, but if there are important differences in the libraries or elsewhere, I'm sure I could find the money.

推荐答案

我将为您提供我的观点,而不是向您提供完整的差异列表.

Rather than provide you with a complete list of differences, I'll give you my view on the matter.

如果您仔细阅读所提供的Wiki页面,您会经常看到诸如"Octave同时支持,而MATLAB需要第一个同时支持"之类的句子.这表明Octave的开发人员试图使Octave语法"superior" 到MATLAB的.

If you read carefully the wiki page you provide, you'll often see sentences like "Octave supports both, while MATLAB requires the first" etc. This shows that Octave's developers try to make Octave syntax "superior" to MATLAB's.

这种态度使Octave完全失去了目标. Octave背后的想法是(或者已经成为,我应该说,请参阅下面的评论)以拥有一种运行m代码的开源替代方案.如果它试图变得更好",那么它就会试图变得与众不同",这与大多数人使用它的原因不符.以我的经验,除了非常简单,非常简短的内容外,运行在MATLAB中开发的内容永远不会一劳永逸-对于任何相当大的功能,如果要在Octave中运行,我总是必须翻译很多内容,如果不要从头开始重写它. 更好,我真的看不到...

This attitude makes Octave lose its purpose completely. The idea behind Octave is (or has become, I should say, see comments below) to have an open source alternative to run m-code. If it tries to be "better", it thus tries to be different, which is not in line with the reasons most people use it for. In my experience, running stuff developed in MATLAB doesn't ever work in one go, except for the really simple, really short stuff -- For any sizable function, I always have to translate a lot of stuff before it works in Octave, if not re-write it from scratch. How this is better, I really don't see...

此外,如果您学习Octave,则Octave中允许使用的语法很多,而MATLAB中则不允许.含义-如果不进行大量转换,用Octave编写的代码通常无法在MATLAB中运行. 相反,它也不兼容!

Also, if you learn Octave, there's a lot of syntax allowed in Octave that's not allowed in MATLAB. Meaning -- code written in Octave often does not work in MATLAB without numerous conversions. It's also not compatible the other way around!

我可以继续:MathWorks有很多用于MATLAB的工具箱,还有Simulink及其相关产品,实际上在Octave中没有同等的产品(是的,您必须为所有这些支付费用.但是通常您的雇主/学校需要为此付费.无论如何,至少在至少[em> )存在,并证明其符合几种行业标准,测试工具,验证工具,需求管理系统,报告生成,更大的社区以及用户群等,等等.MATLAB只是很大一部分的一小部分.八度是...只是八度.

I could go on: The MathWorks has many toolboxes for MATLAB, there's Simulink and its related products for which there really is no equivalent in Octave (yes, you'd have to pay for all that. But often your employer/school does that anyway, and well, it at least exists), proven compliance with several industry standards, testing tools, validation tools, requirement management systems, report generation, a much larger community & user base, etc. etc. etc. MATLAB is only a small part of something much larger. Octave is...just Octave.

所以,我的建议:

  • 了解您的学校是否愿意为MATLAB付款.他们经常会.
  • 如果没有,并且您可以凑足金钱,请购买MATLAB并学习正确使用它的方法.从长远来看,这是一个更好的决定.
  • 如果您真的无法赚钱,请使用Octave,但请学习 MATLAB的语法,并远离仅使用Octave的语法. (请参见注释)
  • Find out if your school will pay for MATLAB. Often they will.
  • If they don't, and if you can scrape together the money, buy MATLAB and learn to use it properly. In the long run it's the better decision.
  • If you really can't get the money -- use Octave, but learn MATLAB's syntax and stay away from Octave-only syntax. (see note)

为什么这最后一点?因为在科学中,通常有很多完全用MATLAB编写的代码库.有很多教授,工程师,学生,专业编码人员,很多人知道MATLAB的所有复杂细节,而对Octave的了解却很少.

Why this last point? Because in the sciences, there are often large code bases entirely written in MATLAB. There are professors, engineers, students, professional coders, lots and lots of people who know all the intricate gory details of MATLAB, and not so much of Octave.

如果您找到一份新工作,而您新办公室中的每个人都说西班牙语,那么要求每个人从那时起就开始说英语是一种自大的想法,这仅仅是因为不说话/例如西班牙文.与MATLAB和Octave相同.

If you get a new job, and everyone in your new office speaks Spanish, it's kind of cocky to demand of everyone that they start speaking English from then on, simply because you don't speak/like Spanish. Same with MATLAB and Octave.

注意事项-如果所有拒绝投票的人都可以发表评论并提出反对我的理由,那就太好了:)

NB -- if all downvoters could just leave a comment with their arguments and reasons for disagreeing with me, that'd be great :)

注意:Octave可以在传统模式"下运行(通过在启动Octave时包含--traditional标志),这使得在使用某些仅使用Octave的语法时会产生错误.

Note: Octave can be run in "traditional mode" (by including the --traditional flag when starting Octave) which makes it give an error when certain Octave-only syntax is used.

这篇关于Octave和MATLAB之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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