开发者

Is there a way to get the MATLAB version without starting the engine?

Is there a way to get the version of MATLAB without launching the engine? When launched (in non-GUI mode) it prints the version 开发者_运维知识库to stout - but I am using it remotely from Java and so that output is not available.

As an alternative, is there a way to get the version from within MATLAB?

By 'version' I mean preferably the double-string number, e.g "7.13" as opposed to the release number e.g "R2011b".

Thanks! James


As Jonas said, the version command is your friend. Use

v = version

to get the numeric version (followed by the "R-release" version) in a string, as follows:

v =
7.12.0.39132 (R2011a)

Then, you should be able to parse the string to get just the beginning numeric part.

See the MathWorks documentation for VERSION at

http://www.mathworks.com/help/techdoc/ref/version.html

for more information.

An additional hint; if you're looking for the version number to ensure that the installed MATLAB is no older than (some particular release number), check out the documentation for VERLESSTHAN, at http://www.mathworks.com/help/techdoc/ref/verlessthan.html It might help you solve your problem without having to parse the string yourself.


I don't know if the following works in all releases, but try running:

matlab -help

This displays the command line usage, and interestingly at the end, it print the version (MATLAB is not started in the process):

matlab [-? ^| -h ^| -help]
       [-c licensefile]
       [-nosplash]
       [-nodesktop ^| -nojvm]

<...TRUNCATED...>

    -shieldload <list>   - Win32 only: (experimental) loads dlls identified in
                                   comma separated list


    Version: 7.13.0,564

You could easily obtain the version number from that output (grep is your friend)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜