[Dart-dev] [6830] DART/trunk/DART_LAB/matlab: updated version of 'donorm', renamed and streamlined

nancy at ucar.edu nancy at ucar.edu
Wed Feb 26 14:33:33 MST 2014


Revision: 6830
Author:   nancy
Date:     2014-02-26 14:33:32 -0700 (Wed, 26 Feb 2014)
Log Message:
-----------
updated version of 'donorm', renamed and streamlined
based on input from tim and jeff.

Added Paths:
-----------
    DART/trunk/DART_LAB/matlab/norm_pdf.m

Removed Paths:
-------------
    DART/trunk/DART_LAB/matlab/donorm.m

-------------- next part --------------
Deleted: DART/trunk/DART_LAB/matlab/donorm.m
===================================================================
--- DART/trunk/DART_LAB/matlab/donorm.m	2014-02-26 21:33:07 UTC (rev 6829)
+++ DART/trunk/DART_LAB/matlab/donorm.m	2014-02-26 21:33:32 UTC (rev 6830)
@@ -1,26 +0,0 @@
-function [y] = donorm(x, mu, sigma)
-%  computes a gaussian (normal) probabilty distribution function
-%  for the points of X with a given mean (mu) and standard deviation (sigma)
-% 
-% normal plot, y given x:
-%  y = (1 / sigma * sqrt(2*pi)) * e ^^ ((-1/2 * ((x-mu) / sigma)^^2)
-% or
-%  g(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2 }. 
-
-%% DART software - Copyright 2004 - 2013 UCAR. This open source software is
-% provided by UCAR, "as is", without charge, subject to all terms of use at
-% http://www.image.ucar.edu/DAReS/DART/DART_download
-%
-% DART $Id$
-
-
-e = 2.71828182845904523536;
-
-basen = (1.0 / (sigma * sqrt(2*pi)));
-expon = -0.50 .* (((x-mu) / sigma).^2 );
-
-y = basen .* (e .^ expon);
-
-end
-
- 

Copied: DART/trunk/DART_LAB/matlab/norm_pdf.m (from rev 6822, DART/trunk/DART_LAB/matlab/donorm.m)
===================================================================
--- DART/trunk/DART_LAB/matlab/norm_pdf.m	                        (rev 0)
+++ DART/trunk/DART_LAB/matlab/norm_pdf.m	2014-02-26 21:33:32 UTC (rev 6830)
@@ -0,0 +1,28 @@
+function [y] = norm_pdf(x, mu, sigma)
+%  computes a gaussian (normal) PDF
+%  for the points of X with a given mean (mu) and standard deviation (sigma)
+% 
+% normal plot, y given x:
+%  y = (1 / (sigma * sqrt(2*pi))) * e ^ ((-1/2 * ((x-mu) / sigma)^2)
+% or
+%  g(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2 }. 
+%
+% see: https://en.wikipedia.org/wiki/Probability_density_function
+
+%% DART software - Copyright 2004 - 2013 UCAR. This open source software is
+% provided by UCAR, "as is", without charge, subject to all terms of use at
+% http://www.image.ucar.edu/DAReS/DART/DART_download
+%
+% DART $Id$
+
+
+e = exp(1);
+
+basen = (1.0 / (sigma * sqrt(2*pi)));
+expon = -0.5 * (((x-mu) / sigma).^2 );
+
+y = basen * (e .^ expon);
+
+end
+
+ 


More information about the Dart-dev mailing list