This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 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, write to the Free Software % Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA % if nargin==1, m=0;s=1; elseif nargin==2, s=1; end; e % allocate output memory and check size of argument z = (x-m)./s; % if this line causes an error, input arguments do not fit. %p = ((2*pi)^(-1/2))*exp(-z.^2/2)./s; SQ2PI = 2.5066282746310005024157652848110; p = exp(-z.^2/2)./(s*SQ2PI); p p((x==m) & (s==0)) = inf; p p(isinf(z)~=0) = 0; p p(isnan(x) | isnan(m) | isnan(s) | (s<0)) = nan;...
View Full Document
This note was uploaded on 07/08/2011 for the course EE 440 taught by Professor Jenq-nenghwang during the Spring '11 term at University of Washington.
- Spring '11