Occasionally I record missing data, invalid data or erroneous data as NaN. But if I have a array of data where the columns are different measurements and the rows are different measurement times the NaNs make it difficult to perform statistical operations on.
This Function will perform a function on the data (assuming the function is designed to operate on an array) but it will ignore any NaNs.
X=[ 1 2 4;
1 5 NaN;
NaN 3 1]
NaN 1.5275 NaN
0 1.5275 2.1213
This function is designed to work on any size array.