Ensurep: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Jeremy
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Verifies that input contains only probabilities in [0,1].
Verifies that input contains only probabilities in [0,1].
===Synopsis===
===Synopsis===
:prob = ensurep(prob)
 
:prob = ensurep(x)
 
===Description===
===Description===
The input is a real (x) and the output is (prob):
The input is a real (x) and the output is (prob):
     If x > 1, then prob = 1.
     If x > 1, then prob = 1.
     If x < 0, then prob = 0.
     If x < 0, then prob = 0.
     If x imaginary, inf, or NaN, then prob = NaN.
     If x imaginary, inf, or NaN, then prob = NaN.
===Examples===
===Examples===
prob = ensurep(prob);
prob = ensurep(prob);
===See Also===
===See Also===
[[ck_function]]
[[ck_function]]

Latest revision as of 13:27, 22 February 2013

Purpose

Verifies that input contains only probabilities in [0,1].

Synopsis

prob = ensurep(x)

Description

The input is a real (x) and the output is (prob):

   If x > 1, then prob = 1.
   If x < 0, then prob = 0.
   If x imaginary, inf, or NaN, then prob = NaN.

Examples

prob = ensurep(prob);

See Also

ck_function