[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: matrix addition skipping nan values
From: |
Søren Hauberg |
Subject: |
Re: matrix addition skipping nan values |
Date: |
Sat, 19 Dec 2009 18:27:35 +0100 |
lør, 19 12 2009 kl. 12:02 -0500, skrev Naveen Garg:
> I would like to do element wise addition over matrices while skipping
> NaN values. there is nansum, but it does column wise addition within a
> matrix.
I don't quite follow what you mean by "skipping" NaN values. Do you
simply want to let NaN's work like zeros? If so, you should be able to
do something like (untested code)
a (isnan (a)) = 0;
b (isnan (b)) = 0;
c = a + b;
Søren