Octave与MATLAB之间的差异 [英] Differences between Octave and MATLAB

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

问题描述

我是一位了解 Python Ruby 和一些 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. The above link shows several examples where they are syntactically similar or identical. Is this true for the whole language?

我正在尝试学习该语言以进行更多的科学计算,可能会使用一些图像分析库.

I am trying to learn the language in general to do more scientific computing, possibly using some image analysis libraries.

此外,MATLAB值得吗?

Additionally, is MATLAB worth the cost?

推荐答案

我不会向您提供完整的差异列表,而是向您提供我对此事的看法.

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

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

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中开发的内容永远不会一work而就-对于任何相当大的功能,如果要在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.

注意:八度可以在传统模式"下运行.(通过在启动 Octave 时包含 --traditional 标志)这使得它在使用某些 Octave-only 语法时出错.

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天全站免登陆