如何检测运行的是MATLAB还是Octave? [英] How do I detect if I'm running MATLAB or Octave?

查看:150
本文介绍了如何检测运行的是MATLAB还是Octave?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写可以在Octave和MATLAB上同样良好运行的代码.问题在于它需要做一些GUI东西,而MATLAB和Octave处理的东西完全不同.

I need to write code that should run equally well in Octave and on MATLAB. Problem is that it needs to do some GUI stuff, which MATLAB and Octave handle completely differently.

有没有一种方法可以检测我是在运行MATLAB还是Octave,以便调用正确的函数?

Is there a way I can detect if I'm running MATLAB or Octave, in order to call the right function?

推荐答案

您可以使用以下测试将Octave与MATLAB区别开来:

You could use the following test to differentiate Octave from MATLAB:

isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0;

这篇关于如何检测运行的是MATLAB还是Octave?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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