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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With