-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.m
56 lines (45 loc) · 1.52 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
% Install script for EDGE
% by Michael Gelbart
clear all; clc;
% ***user-defined *** %
JAVA_NAME = fullfile('java1', 'bin');
MATLAB_NAME = 'Matlab';
MEASUREMENTS_NAME = 'Measurements';
JAVA_MEMORY_STRING = '-Xmx512m';
% ******************* %
% get the path to this file
[program_dir] = fileparts(mfilename('fullpath'));
%% add the Measurements and Matlab folders to the path
matlab_path = fullfile(program_dir, MATLAB_NAME);
measurements_path = fullfile(program_dir, MEASUREMENTS_NAME);
addpath(matlab_path, measurements_path);
savepath;
%% edit the java.opts file
root_dir = matlabroot; % the Matlab root directory
opts_directory_location = fullfile(root_dir, 'bin', computer('arch'), 'java.opts');
fid = fopen(opts_directory_location, 'a');
% if fid < 0
% disp(['install.m: Cannot find file ', opts_directory_location]);
% disp('Installation aborted.');
% return;
% end
if fid >= 0
fprintf(fid, '\n%s', JAVA_MEMORY_STRING);
fclose(fid);
end
%% edit the classpath file -- NOW ADDED TO DYNAMIC PATH IN semiauto.m AND edge.m
java_path = fullfile(program_dir, JAVA_NAME);
classpath_name = fullfile(matlabroot, 'toolbox', 'local', 'classpath.txt');
fid = fopen(classpath_name, 'a');
% if fid < 0
% disp(strcat('install.m: Cannot find file ', classpath_name));
% disp('Installation aborted.');
% return;
% end
if fid > 0
fprintf(fid, '\n%s', java_path);
fclose(fid);
end
%% message to user
msgbox('Installation completed. You must restart Matlab before continuing.', ...
'Installation successful');