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

查看:29
本文介绍了如何检测我是在运行 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天全站免登陆