comparison util/SMALL_learn.m @ 189:75b5dedcfd45 luisf_dev

created initialization file; changing SMALL_learn in order to initialize plugins.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Thu, 16 Feb 2012 18:24:43 +0000
parents b14209313ba4
children
comparison
equal deleted inserted replaced
187:3cc204120431 189:75b5dedcfd45
99 % % parameters given above 99 % % parameters given above
100 % 100 %
101 % D = eval([DL.name,'(<Preffered_API>);']); 101 % D = eval([DL.name,'(<Preffered_API>);']);
102 102
103 else 103 else
104 % register other toolboxes from the extra plugins folder
105 folders = dir('extra');
106 extra_plugins = folders(arrayfun(@(x) x.name(1), folders) ~= '.');
107 extra_plugins = extra_plugins([extra_plugins.isdir])
108
109 if length(extra_plugins) > 0
110 printf('Found %i extra plugin(s) in the extra plugins folder.\n', length(extra_plugins));
111
112 for i=1:length(extra_plugins)
113 printf('Initializing extra plugin "%s"', extra_plugins(i).name);
114
115 %% adds all files from path
116 genpath(['extra/', extra_plugins(i).name]);
117
118 % open plugin's init file
119
120
121 init_file = ['extra/', extra_plugins(i).name, '/init.m'];
122
123 if ~(exist(init_file == 2)
124 error(['Plugin ', extra_plugins(i).name, ' init file does not exist. Exiting now...'])
125 else
126 % get the correct function handle and run it
127 init_file
128
129 end
130 end
131
132 else
133 printf('No extra plugins found.')
134 end
135
136
137
104 printf('\nToolbox has not been registered. Please change SMALL_learn file.\n'); 138 printf('\nToolbox has not been registered. Please change SMALL_learn file.\n');
105 return 139 return
106 end 140 end
107 141
108 %% 142 %%