Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

linux

matlab

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

like image 648
gub Avatar asked Oct 09 '11 22:10

gub


2 Answers

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.

like image 181
Bob Gilmore Avatar answered Nov 15 '22 17:11

Bob Gilmore


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)

like image 36
Amro Avatar answered Nov 15 '22 18:11

Amro