plusPURPOSEAdds a Gaussian and a constant/Gaussian.
SYNOPSISfunction g=plus(g1,g2)
DESCRIPTIONAdds a Gaussian and a constant/Gaussian. Add two Gaussians: Add the mean and the covariance. This results on a convolution of one Gassian into another. If one of the parameters is not a Gaussian, we offset the mean of the Gaussian given as a parameter. See also offset. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function g=plus(g1,g2) 0002 % Adds a Gaussian and a constant/Gaussian. 0003 % 0004 % Add two Gaussians: Add the mean and the covariance. This results on a 0005 % convolution of one Gassian into another. 0006 % If one of the parameters is not a Gaussian, we offset the mean of the 0007 % Gaussian given as a parameter. 0008 % 0009 % See also offset. 0010 0011 if isa(g1,'Gaussian') 0012 if isa(g2,'Gaussian') 0013 g=Gaussian(g1.m+g2.m,g1.S+g2.S); 0014 else 0015 if isa(g2,'double') 0016 g=Offset(g1,g2); 0017 else 0018 error('Invalid parameter type in Gaussian mtimes') 0019 end 0020 end 0021 else 0022 g=plus(g2,g1); 0023 end 0024 0025 |