-
Notifications
You must be signed in to change notification settings - Fork 8
/
Install.m
62 lines (55 loc) · 2.12 KB
/
Install.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
%% Installing CAT
%
%% Downloading
%
% Download the latest version of CAT from the SPL website:
% http://www.ipe.ethz.ch/laboratories/spl/cat
%
%
%% Installing
%
% Extract the zip file somewhere, copy the whole folder to somewhere where
% you keep Matlab files, or in the Matlab toolbox folder
%
% Once this is done, either add the folder to your Matlab path by:
%
% # Adding the folder to the path:
% >> addpath(folder)
% # Optionally, save the path for future Matlab sessions by running:
% >> savepath
%
% Alternatively, you can execute this file (Install.m) within Matlab with
% the CAT Toolbox folder as your working directory
% Copyright 2015-2016 David Ochsenbein
% Copyright 2012-2014 David Ochsenbein, Martin Iggland
%
% This file is part of CAT.
%
% CAT is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation version 3 of the License.
%
% CAT is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
% Check that we are in the right directory
if exist('@CAT','dir')
% The folder to add to the path is the current working directory
addpath(pwd);
% Ask the user if she wants to save the path permanently
button = questdlg('Do you want to permanently add the CAT Toolbox to your Matlab path?','Save path?','Yes','No','Yes');
if strcmp(button,'Yes')
save = savepath;
if save == 0
helpdlg('The CAT Toolbox was permanently added to your Matlab path')
else
errordlg('The path changes could not be saved. You will need to add the CAT Toolbox to the path again next time you start Matlab','Error saving path');
end % if
end
else
errordlg('This script needs to be executed with the CAT Toolbox folder as your working directory','Wrong directory');
end