ncchi2_4.m

来自「GPS TOOLBOX包含以下内容: 1、GPS相关常量和转换因子; 2、角」· M 代码 · 共 27 行

M
27
字号
%                             ncchi2_4.m
%  Scope:   This MATLAB macro computes the probability density function of the 
%           non-central chi-square distribution with four degrees of freedom.
%  Usage:   xoutput = ncchi2_4(x,lambda)
%  Description of parameters:
%           x       - input, scalar independent variable
%           lambda  - input, non-centrality parameter
%           xoutput - output, computed probability density function 
%  Remark:  This macro can be used for the computation of the integral of the
%           probability density function.
%  Last update:  04/12/00
%  Copyright (C) 1997-00 by LL Consulting. All Rights Reserved.

function  xoutput = ncchi2_4(x,lambda)

sum = 1.;
temp = sum;

for k = 1:49
   termk = temp.*lambda.*x./(4.*k.*(k+1));
   sum = sum + termk;
   temp = termk;
end

a = 0.25;
xoutput = a.*sum.*(exp(-0.5.*(x+lambda))).*x;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?