Mercurial > hg > octave-image
annotate inst/mean2.m @ 614:3a17c7402cc3
mean2: use other isimage internally
author | carandraug |
---|---|
date | Wed, 26 Sep 2012 07:36:15 +0000 |
parents | c45838839d86 |
children |
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 | 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 | 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 | 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 | 15 |
16 ## -*- texinfo -*- | |
614 | 17 ## @deftypefn {Function File} {@var{m}=} mean2 (@var{I}) |
18 ## Compute the mean value of the 2D image @var{I}. | |
19 ## | |
20 ## Note that @var{m} will be of class double, independently of the input class. | |
21 ## This is equivalent to @code{mean (I(:))}. | |
22 ## | |
23 ## @seealso{mean, std2} | |
186 | 24 ## @end deftypefn |
25 | |
26 function m = mean2 (I) | |
27 | |
614 | 28 if (nargin != 1) |
222 | 29 print_usage(); |
614 | 30 elseif (!isimage (I) || ndims (I) != 2) |
31 error("mean2: argument must be a 2D image"); | |
186 | 32 endif |
33 m = mean (I(:)); | |
34 endfunction |