Home > Archive > Matlab > June 2007 > NaN replace by zero
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
NaN replace by zero
|
|
|
| Hi,
Is it possible to replace "NaN" to zero (0)? For example, X = [ 1, 2,
,3] and when MatLab reads : X = 1 2 NaN 3. So, the "NaN" in this
matrix, is it possible to replace by 0? Which gives to X = [1, 2, 0,
3].
Thanks,
Le
| |
| per isakson 2007-06-29, 8:13 am |
| Le wrote:
>
>
> Hi,
>
> Is it possible to replace "NaN" to zero (0)? For example, X = [ 1,
> 2,
> ,3] and when MatLab reads : X = 1 2 NaN 3. So, the "NaN" in this
> matrix, is it possible to replace by 0? Which gives to X = [1, 2,
> 0,
> 3].
>
> Thanks,
>
> Le
X(isnan(X))=0;
/ per
| |
|
|
|
|
|