Do you mean something like:
# Replace NANs in matrix by zeros
M = isnan(M) ? 0 : M
# Replace zeros in matrix OUT by 999
M = OUT ? OUT : 999
# Check for conditions and replace zero by 1 if the condition v .< x is 
met (x and v are both matrices)
mtmp = {}
mtmp = (v .< x)
Artur
On 25.11.2014 21:13, Logan Kelly wrote:
 Hello,
 I need a function the tests if variable is in an array (sorry for the 
 poor wording of this sentence). What I mean by this is a function that 
 compares each element of an array to a variable and returns 0 if no 
 elements of the array are equal and the position in the array of the 
 first instance of equality. So here are my question:
 1.  Dose such a function exist? (I haven’t found one, but I thought I 
 should ask)
 2. If not, coding it up is no problem, but I need a way to check the 
 data type of variable. Is there such a command?
 3. Is there a way, other than using a bundle, to pass a variable of 
 unknown data type to a function?
 Thanks,
 Logan
 _______________________________________________
 Gretl-devel mailing list
 Gretl-devel(a)lists.wfu.edu
 
http://lists.wfu.edu/mailman/listinfo/gretl-devel