eql_root.m

来自「实现PET/SPECT 幻影图像regression的matlab源代码 al」· M 代码 · 共 26 行

M
26
字号
 function x = eql_root(a, b, c)%function x = eql_root(a, b, c)% Numerically stable method for computing the positive root% of the quadratic polynomial: -ax^2 -2bx + c, with a >= 0.% This polynomial arises in quadratically-penalized likelihood% methods for the Poisson emission image reconstruction problem.%% Copyright Apr. 2000, Jeff Fessler, The University of Michiganif nargin < 3, help(mfilename), error(mfilename), endif any(a < 0), error 'need a > 0', endx = zeros(size(a));j = a == 0;x(j) = c(j) ./ b(j) / 2;		% 1st-order casedet = sqrt(b.^2 + a .* c);		% determinant / 2j = (a > 0) & (b > 0);x(j) = c(j) ./ (det(j) + b(j));j = (a > 0) & (b <= 0);x(j) = (det(j) - b(j)) ./ a(j);

⌨️ 快捷键说明

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