~ubuntu-branches/ubuntu/quantal/octave-missing-functions/quantal

« back to all changes in this revision

Viewing changes to inst/missingmatlabfunctions.m

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2008-05-21 09:08:52 UTC
  • Revision ID: james.westby@ubuntu.com-20080521090852-kmab4xonk38otmr1
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## Copyright (C) 2008 Bill Denney
 
2
##
 
3
## This software is free software; you can redistribute it and/or modify it
 
4
## under the terms of the GNU General Public License as published by
 
5
## the Free Software Foundation; either version 3 of the License, or (at
 
6
## your option) any later version.
 
7
##
 
8
## This software is distributed in the hope that it will be useful, but
 
9
## WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
## General Public License for more details.
 
12
##
 
13
## You should have received a copy of the GNU General Public License
 
14
## along with this software; see the file COPYING.  If not, see
 
15
## <http://www.gnu.org/licenses/>.
 
16
 
 
17
## -*- texinfo -*-
 
18
## @deftypefn {Function File} {} matlabfunctionlist (@var{outfile}, @var{outformat}, @var{url})
 
19
## Show or write to @var{outfile} the missing Matlab functions listed at
 
20
## the category index @var{url}.  @var{outformat} is the output format
 
21
## to show or write and it may be one of "wiki" (default) or "html".
 
22
## @seealso{missingfunctionstatus}
 
23
## @end deftypefn
 
24
 
 
25
function missingmatlabfunctions (outfile = "", outformat = "", url = "http://www.mathworks.com/access/helpdesk/help/techdoc/ref/f16-6011.html")
 
26
 
 
27
  [funlist, funloc, catlist, catloc, catlvl] = __matlabfunctionlist__ (url);
 
28
  funstat = __functionstatus__ (funlist);
 
29
 
 
30
  ## guess the output format defaulting to wiki.
 
31
  if isempty (outformat)
 
32
    if isempty (outfile)
 
33
      outformat = "wiki";
 
34
    else
 
35
      [dirname, filename, ext] = fileparts (outfile);
 
36
      if (! isempty (findstr (ext, "htm")))
 
37
        outformat = "html";
 
38
      else
 
39
        outformat = "wiki";
 
40
      endif
 
41
    endif
 
42
  endif
 
43
 
 
44
  output = __missingmatlab2txt__ (funlist, funloc, funstat,
 
45
                                  catlist, catloc, catlvl, outformat);
 
46
  if isempty (outfile)
 
47
    printf ("%s", output{:});
 
48
  else
 
49
    [fid msg] = fopen (outfile, "wt");
 
50
    if (fid < 0)
 
51
      error ("missingmatlabfunctions: error opening %s, %s", outfile, msg);
 
52
    endif
 
53
    fprintf (fid, "%s", output{:});
 
54
    fclose (fid);
 
55
  endif
 
56
 
 
57
endfunction