source: MML/trunk/machine/SOLEIL/common/toolbox/GUILayout/install.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.2 KB
Line 
1function install()
2%install  add the layout package to the MATLAB path
3%
4%   install() adds the necessary folders to the MATLAB path for the layout
5%   tools to be used from anywhere.
6%
7%   Examples:
8%   >> install()
9%
10%   See also: uninstall
11
12%   Copyright 2008-2010 The MathWorks Ltd.
13%   1.1
14%   2012/05/08 08:02:59
15
16% Check the version
17minVersionDate = '25-Jan-2010';
18matlabVersion = ver( 'MATLAB' );
19if datenum( matlabVersion.Date ) < datenum( minVersionDate )
20    warning( 'Layouts:VersionTooOld', 'This toolbox has been built and tested on MATLAB release R2010a and above. You appear to be using an older version and will almost certainly experience problems or even MATLAB crashes.' )
21end
22
23% Add the folders to the path
24thisdir = fileparts( mfilename( 'fullpath' ) );
25
26dirs = {
27    thisdir
28    fullfile( thisdir, 'Patch' )
29    fullfile( thisdir, 'layoutHelp' )
30    };
31
32for dd=1:numel( dirs )
33    addpath( dirs{dd} );
34    fprintf( '+ Folder added to path: %s\n', dirs{dd} );
35end
36
37% Save the changes to make the installation permanent
38if savepath()==0
39    % Success
40    fprintf( '+ Path saved\n' );
41else
42    % Failure
43    fprintf( '- Failed to save path, you will need to re-install when MATLAB is restarted\n' );
44end
Note: See TracBrowser for help on using the repository browser.