0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 % DISPLAYMODELOVERVIEW diesplays the model overview in the MATLAB browser.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 % DESCRIPTION: DISPLAYMODELOVERVIEW diesplays the model overview in the
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 % MATLAB browser.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 % CALL: displayModelOverview(modelName)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 % INPUTS: modelName: String with the model name
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 % VERSION: $Id: displayModelOverview.m,v 1.2 2010/10/29 16:11:13 ingo Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 function varargout = displayModelOverview(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 % Check the inputs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 if nargin ~= 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 error('### Unknown number of inputs');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 elseif ~ischar(varargin{1})
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 error('### The input must be a model name (String)');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 modelName = varargin{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 txt = modelOverview(feval(modelName, 'info'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 % Workaround for the broken anchor tags in the HTML page.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 % It is necessary to write the HTML page to disk.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 dynamicHelpPath = fullfile(prefdir(), 'dynamicHelp', 'models');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 if ~exist(dynamicHelpPath, 'dir')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 mkdir(dynamicHelpPath);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 filename = sprintf('%s.html', modelName);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 file = fullfile(dynamicHelpPath, filename);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 fid = fopen(file, 'w');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 fwrite(fid, txt, 'char');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 fclose(fid);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 web(file, '-new', '-noaddressbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 end
|