How can I test a successful installation of MATLAB?

38 views (last 30 days)
There is a need to automatically verify successful installations of MATLAB and related products. Often, IT staff without deep MATLAB knowledge is performaing an installation, but does not know how to verify if all necessary functionality is working.
The goal of this question is to collect commands and automated procedures that help IT staff to verify. This includes:
  • Successful installation and licensing of products
  • Basic functionality like mathematical operations and graphics
  • Functionality that needs interfaces, like import and export or a working C compiler
Thank you for your contribution!

Answers (7)

Andreas Goser
Andreas Goser on 15 Mar 2012
The BENCH command itself contains a couple of useful tests. Designed for perfomance tests though:
bench(5)

Friedrich
Friedrich on 15 Mar 2012
Hi,
I would say, check if a specific compiler is installed correctly, or check which compilers MATLAB find and can use (Windows specific code)
mex_compiler_files = dir([fullfile(matlabroot,'bin',computer('arch'),'mexopts'),'\*.bat']);
mbuild_compiler_files = dir([fullfile(matlabroot,'bin',computer('arch'),'mbuildopts'),'\*.bat']);
disp('-----------------------------------')
disp('NOW MEX')
disp('-----------------------------------')
for i=1:numel(mex_compiler_files)
%check for engine and mat file bat files, we want bat files for mexing
%only
if isempty(strfind(mex_compiler_files(i).name,'engmat'))
try
%try to select the compiler
evalc('mex([''-setup:'',mex_compiler_files(i).name(1:strfind(mex_compiler_files(i).name,''opts'')-1)])');
disp(['Compiler : ',mex_compiler_files(i).name,' is installed correctly'])
catch err
disp(['Compiler : ',mex_compiler_files(i).name,' is not installed correctly'])
end
end
end
disp('-----------------------------------')
disp('NOW MBUILD')
disp('-----------------------------------')
for i=1:numel(mbuild_compiler_files)
try
%try to select the compiler
evalc('mbuild([''-setup:'',mbuild_compiler_files(i).name(1:strfind(mbuild_compiler_files(i).name,''compp'')-1)])');
disp(['Compiler : ',mbuild_compiler_files(i).name,' is installed correctly'])
catch err
disp(['Compiler : ',mbuild_compiler_files(i).name,' is not installed correctly'])
end
end

Friedrich
Friedrich on 15 Mar 2012
Hi again,
you can also check if you are able to checkout the licenses you want:
lm_list = feature('lmfeaturelist')
for i=1:numel(lm_list)
if license('checkout',lm_list{i}) == 1
disp(['License for Toolbox : ',lm_list{i}, ' is available '])
else
disp(['License for Toolbox : ',lm_list{i}, ' is not available '])
end
end

Sean de Wolski
Sean de Wolski on 15 Mar 2012
Does:
ver
work and what is the output of it? Does the output match what you intended to install?
  1 Comment
Thomas O'Donnell
Thomas O'Donnell on 29 May 2013
ver works on the desktop and shows the license number, o/s, and tool boxes allowed to run. You must start matlab on the headnode from a cmd prompt
cd $MATLAB\bin (where $MATLAB is the installation folder for MATLAB on the cluster) matlab.exe -dmlworker -nodisplay -logfile C:\output.txt -r ver;exit
to get the details on the head node or job manager server with the MATLAB flexnet license manager running on it.

Sign in to comment.


Andreas Goser
Andreas Goser on 15 Mar 2012
Fast and easy ways to test the functionality of a product:
Simulink:
sim('vdp')
Control System Toolbox:
tf(1, [1 1])
  1 Comment
Julian Hapke
Julian Hapke on 17 Nov 2023
This only works if examples are included. If now this will throw an error. MATLAB could be able to load examples from the web, but only if the openExample command is used to...well...open an example. I know in 2012 this was propably not an issue, I just wanted to make this answer a bit contemporary.

Sign in to comment.


Jason Ross
Jason Ross on 15 Mar 2012
To check setup Parallel Computing Toolbox, you can do the following:
  • Validate a configuration to ensure that that the MATLAB client is set up properly to run various jobs against a cluster. This works for all configuration types, and does not require MATLAB knowledge. You can validate a configuration under the Parallel > Manage Configurations dialog.
  • In the Admin Center, located in matlabroot/toolbox/distcomp/bin/admincenter, administrators can set up a MJS cluster, control services, stop and start the server, and stop and start workers. There are also connectivity tests that make sure that the head node and workers can communicate to help troubleshoot cluster setup issues.
  • From the command line, in matlabroot/toolbox/distcomp/bin, the "nodestatus" command can tell you the status of the cluster. You can also stop and start mdce, MJS and workers from here, as well using the various start and stop commands.
  1 Comment
Thomas O'Donnell
Thomas O'Donnell on 29 May 2013
Outstanding advice. Is Mathworks going to make a web version of this feature so powerusers can check the Parallel server status from their desktops ?

Sign in to comment.


Daniel Shub
Daniel Shub on 15 Mar 2012
For Linux systems in particular there tend to be issues with
  1. fonts in figures http://www.mathworks.com/matlabcentral/answers/1238-font-size-changes-in-figures,
  2. libc.so.6 http://www.mathworks.com/matlabcentral/answers/10134-usr-local-matlab-r2011a-bin-util-oscheck-sh-605-lib64-libc-so-6-not-found,
  3. environment variables http://www.mathworks.com/matlabcentral/answers/30029-problem-starting-matlab-on-64-bit-linux
  4. OpenGL and hardware acceleration (you can check that you have it correct with
opengl('info')
#+4 (anyone know how to continue numbering a list?) Sound issues, not that anyone expects it to work in Linux, but ideally
load('handel');
sound(y, Fs);
should give you "hallelujah".

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!