annotate inst/mean2.m @ 892:a2140b980079

iptcheckconn: implement in C++ as static method for connectivity. * iptcheckconn.m: file removed; help text and tests reused for C++. * conndef.cc: implement two new connectivity::validate() methods and the iptcheckconn function for Octave as caller to those methods. * conndef.h: define the connectivity::validate() static methods. * COPYING
author Carnë Draug <carandraug@octave.org>
date Wed, 01 Oct 2014 20:22:37 +0100
parents 3a17c7402cc3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
561
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
1 ## Copyright (C) 2000 Kai Habel <kai.habel@gmx.de>
186
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
2 ##
561
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
3 ## This program is free software; you can redistribute it and/or modify it under
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
4 ## the terms of the GNU General Public License as published by the Free Software
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
5 ## Foundation; either version 3 of the License, or (at your option) any later
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
6 ## version.
186
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
7 ##
561
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
8 ## This program is distributed in the hope that it will be useful, but WITHOUT
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
11 ## details.
186
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
12 ##
561
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
13 ## You should have received a copy of the GNU General Public License along with
c45838839d86 maint: update license to GPLv3 and mention non GPL files
carandraug
parents: 321
diff changeset
14 ## this program; if not, see <http://www.gnu.org/licenses/>.
186
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
15
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
16 ## -*- texinfo -*-
614
3a17c7402cc3 mean2: use other isimage internally
carandraug
parents: 561
diff changeset
17 ## @deftypefn {Function File} {@var{m}=} mean2 (@var{I})
3a17c7402cc3 mean2: use other isimage internally
carandraug
parents: 561
diff changeset
18 ## Compute the mean value of the 2D image @var{I}.
3a17c7402cc3 mean2: use other isimage internally
carandraug
parents: 561
diff changeset
19 ##
3a17c7402cc3 mean2: use other isimage internally
carandraug
parents: 561
diff changeset
20 ## Note that @var{m} will be of class double, independently of the input class.
3a17c7402cc3 mean2: use other isimage internally
carandraug
parents: 561
diff changeset
21 ## This is equivalent to @code{mean (I(:))}.
3a17c7402cc3 mean2: use other isimage internally
carandraug
parents: 561
diff changeset
22 ##
3a17c7402cc3 mean2: use other isimage internally
carandraug
parents: 561
diff changeset
23 ## @seealso{mean, std2}
186
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
24 ## @end deftypefn
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
25
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
26 function m = mean2 (I)
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
27
614
3a17c7402cc3 mean2: use other isimage internally
carandraug
parents: 561
diff changeset
28 if (nargin != 1)
222
79ff7c116059 Minor changes in help text
hauberg
parents: 186
diff changeset
29 print_usage();
614
3a17c7402cc3 mean2: use other isimage internally
carandraug
parents: 561
diff changeset
30 elseif (!isimage (I) || ndims (I) != 2)
3a17c7402cc3 mean2: use other isimage internally
carandraug
parents: 561
diff changeset
31 error("mean2: argument must be a 2D image");
186
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
32 endif
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
33 m = mean (I(:));
13c6a9bdec24 Changed the structure to match the package system
hauberg
parents:
diff changeset
34 endfunction