threshold changes the data in an array which does not meet some kind of minimality criterion. It takes the following parameters :
Bound specification may be either a single real number b (or an equation b=value) or a list of two real numbers l,u (or equations l=lvalue, u=uvalue). In the latter case a vector w is returned, as defined by :
wk= |
|
for k=0,1,…,n−1 where n= size( v ) when the element vk is a real number. If vk is complex, then |vk| is compared with u resp. l and the value uvalue resp. lvalue is multiplied by vk/|vk| .
In the first case where bnd is a number or an equation, the return vector w is defined by :
wk= |
|
if vk∈ℝ (if vk is complex, then |vk| is compared with b and the value is multiplied by vk/|vk| ), for k=0,1,…,n−1 . If comparison operator is specified (one of >, <= or >=, must be quoted), it is used instead of < (which is the default) in the above formula. If the fourth argument is specified, the data in v must be real and the following formula is used for wk , k=0,1,…,n−1 :
wk= |
|
As before, value defaults to b and the comparison operator used to test |vk| against b (by default <) is specified by the third argument.
For example, input :
Output :
Input :
Output :
Input :
Output :
Input :
Output :
Input :
Output :
Input :
Output :