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