Mercurial > forge
changeset 10177:fc35701e521a octave-forge
comm: marcumq function has been moved to the signal package
author | mtmiller |
---|---|
date | Sat, 05 May 2012 00:05:09 +0000 |
parents | da40b65ccbdf |
children | d5b9c54950b2 |
files | main/comm/INDEX main/comm/NEWS main/comm/inst/marcumq.m |
diffstat | 3 files changed, 2 insertions(+), 50 deletions(-) [+] |
line wrap: on
line diff
--- a/main/comm/INDEX Sat May 05 00:04:13 2012 +0000 +++ b/main/comm/INDEX Sat May 05 00:05:09 2012 +0000 @@ -177,4 +177,3 @@ vec2mat qfunc qfuncinv - marcumq
--- a/main/comm/NEWS Sat May 05 00:04:13 2012 +0000 +++ b/main/comm/NEWS Sat May 05 00:05:09 2012 +0000 @@ -1,6 +1,8 @@ Summary of important user-visible changes for communications 1.1.1: ------------------------------------------------------------------- + ** The function `marcumq' has been moved to the signal package + ** The following functions are new: convenc
--- a/main/comm/inst/marcumq.m Sat May 05 00:04:13 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -## Copyright (C) 2007 Sylvain Pelissier <sylvain.pelissier@gmail.com> -## -## This program is free software; you can redistribute it and/or modify it under -## the terms of the GNU General Public License as published by the Free Software -## Foundation; either version 3 of the License, or (at your option) any later -## version. -## -## This program is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -## details. -## -## You should have received a copy of the GNU General Public License along with -## this program; if not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {[@var{Q}] =} marcumq (@var{a}, @var{b}, @var{m}) -## Compute the Marcum Q function. -## @end deftypefn - -function Q = marcumq(a,b,m) - - if nargin < 2 - usage(" marcumq(a,b)\n\tmarcumq(a,b,m)"); - end - - if nargin < 3 - m = 1; - end - - l = max([size(a,1) size(b,1) size(m,1)]); - c = max([size(a,2) size(b,2) size(m,2)]); - a = padarray(a,[l-size(a,1) c-size(a,2)],'replicate','post') - b = padarray(b,[l-size(b,1) c-size(b,2)],'replicate','post'); - m = padarray(m,[l-size(m,1) c-size(m,2)],'replicate','post'); - - if (min(a(:)) < 0 || min(b(:)) < 0) - error("a and b must be positive"); - end - - for n = 1:l - for o = 1:c - k = 1-m(n,o):100; - v = (a(n,o)./b(n,o)).^k.*besseli(k,a(n,o).*b(n,o)); - v = sum(v); - Q(n,o) = v.*exp(-(a(n,o).^2+b(n,o).^2)/2); - end - end -endfunction