-
Notifications
You must be signed in to change notification settings - Fork 29
/
startup.m
50 lines (42 loc) · 1.58 KB
/
startup.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
% turn off warnings in Jupyerbook
warning('off','all')
global isOctave;
isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0;
if ~isdeployed
addpath(genpath(fileparts(mfilename('fullpath'))))
% Remove temp dir from path if it exists
tmpDir = fullfile(pwd, 'tmp');
if exist(tmpDir, 'dir')
rmpath(genpath(tmpDir))
end
if ~isOctave % MATLAB
% Test Signal Processing toolbox is installed
if ~license('test', 'Signal_Toolbox'), error('Signal Processing Toolbox is not installed on your system: some RF pulse designs won''t work.'); end
if ~license('test', 'Image_Toolbox'), warning('Image Toolbox is not installed: some display functions will not work. Consider installing <a href="matlab:matlab.internal.language.introspective.showAddon(''IP'');">Image Processing Toolbox</a>'); end
else % OCTAVE
% install octave package
installlist = {'image', 'signal'};
for ii=1:length(installlist)
try
disp(['loading ' installlist{ii}])
pkg('load',installlist{ii})
catch
errorcount = 1;
while errorcount % try to install 30 times (Travis)
try
pkg('install','-forge',installlist{ii})
pkg('load',installlist{ii})
errorcount = 0;
catch err
errorcount = errorcount+1;
if errorcount>30
error(err.message)
end
end
end
end
end
% qt recommended, but not working for JupyterBook compile
% graphics_toolkit('qt')
end
end