forked from UniprJRC/FSDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docsearchFS.m
87 lines (72 loc) · 2.14 KB
/
docsearchFS.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
function docsearchFS(varargin)
%docsearchFS opens inside Help browser html documentation file.
%
%<a href="matlab: docsearchFS('docsearchFS')">Link to the help function</a>
%
% docsearchFS opens the Help browser and displays the documentation home
% page of FS.
%
% docsearchFS('namehtmlhelpfile') searches FSDA documentation page
% of namehtmlhelpfile
%
%
% Copyright 2008-2021.
% Written by FSDA team
%
%
%<a href="matlab: docsearchFS('docsearchFS')">Link to the help page for this function</a>
%
%$LastChangedDate:: $: Date of the last commit
% Examples:
%
%{
% Open main documentation page of FSDA (file index.html)
docsearchFS
%}
%
%
%{
% Open html documentation page of FSDA function named LXS
docsearchFS('LXS')
%}
%% Beginning of code
if nargin <1
namehtmlhelpfile = deblank(sprintf('%s ', varargin{:}));
elseif nargin == 1
namehtmlhelpfile = varargin{1};
else
namehtmlhelpfile = '';
end
a=ver('matlab');
if str2double(a.Version)>7.14
if isempty(namehtmlhelpfile)
webFS([docroot '/FSDA/index.html'])
else
[~,~,ext]=fileparts(namehtmlhelpfile);
if isempty(ext)
namehtmlhelpfile=[namehtmlhelpfile '.html'];
elseif ~strcmp(ext,'.html')
error('FSDA:docsearchFS','Wrong file extension. Extension must be html')
end
webFS([docroot '/FSDA/' namehtmlhelpfile])
end
else
% If installed version of MATLAB is 2012a or older, matlab function web
% is called
FileWithFullPath=which('docsearchFS.m');
[pathFSDAstr]=fileparts(FileWithFullPath);
fsep=filesep;
if isempty(namehtmlhelpfile)
outputOFHtmlHelpFile=[pathFSDAstr fsep 'helpfiles' fsep 'FSDA\index.html'];
web(outputOFHtmlHelpFile);
else
[~,~,ext]=fileparts(namehtmlhelpfile);
if isempty(ext)
outputOFHtmlHelpFile=[pathFSDAstr fsep 'helpfiles' fsep 'FSDA' filesep namehtmlhelpfile '.html'];
else
outputOFHtmlHelpFile=[pathFSDAstr fsep 'helpfiles' fsep 'FSDA' filesep namehtmlhelpfile];
end
webFS(outputOFHtmlHelpFile);
end
end
end