Using Matlab and access to sample Matlab scripts

From InelasticDataReduction
Revision as of 15:46, 8 December 2015 by Alex Buts (talk | contribs)
Jump to navigation Jump to search

Matlab packages for Inelastic Scattering data analysis used in ISIS include Horace and Mslice. The packages have home pages containing extensive description, but most recent and useful sample scripts are provided to users on the file system using HoraceExampleScripts, placed on users desktop at:

 /home/[USER'S_FEDERAL_ID]/Desktop/HoraceExampleScripts 

by script defined in skel configuration.


Isiscompute servers provide users with access to recent version of Matlab and substantial number of floating licenses. Usually number of free licences is sufficient for users doing experiments and data analysis, but if Matlab does not start, number of available licences can be checked using simple bash script:

#!/bin/bash
# check network licence for Matlab
/usr/local/MATLAB/R2014a/etc/glnxa64/lmutil lmstat -c /usr/local/MATLAB/R2014a/licenses/network.lic -a

Horace and Mslice are configured to be accessible from Matlab in two ways:

  • Using startup.m file, which is copied from skel configuration to each user home folder when user account is created. See the description of startup.m file at Mslice and Horace configuration pages for the detailed description of this file contents.
  • By adding special horace_on and similar mslice_on scripts to Matlab default search path. The scripts are doing roughly the same as changes to startup.m file but allow user to initialize Horace and Mslice from arbitrary folder user wants to start Matlab from (not only from his or her home folder) and allows user to reinitialize these packages. This may be convenient for dealing with some errors in the analysis packages or when trying to resolve out of memory situations.

Configuring Matlab to access horace_on and mslice_on scripts

Configuring Matlab to access horace_on and mslice_on scripts on isiscompute server requests superuser access and involves the following steps:

One needs to go to matlab installation folder e.g.

 /usr/local/MATLAB/R2015b/toolbox/local/

and edit pathdef.m file:

 sudo vim pathdef.m

where find the rows:

p=[...
%%% BEGIN ENTRIES %%%
matlabroot,'/toolbox/matlab/lang:',...

and modify them as follows:

p=[...
%%% BEGIN ENTRIES %%%
'/usr/local/mprogs/Users:', ...
 matlabroot,'/toolbox/matlab/lang:',


/usr/local/mprogs/Users: folder is the folder where appropriately configured horace_on and mslice_on packages can be found. See Configure Horace and Configuring Mslice for details on how to configure these scripts.