Re: Data vector
- From: "John D'Errico" <woodchips@xxxxxxxxxxxxxxxx>
- Date: Tue, 29 Apr 2008 12:13:01 +0000 (UTC)
"Floris Zoutman" <fzoutman@xxxxxxxxxxx> wrote in message
<fv72m0$d2h$1@xxxxxxxxxxxxxxxxxx>...
We have a data vector (DEF) which Matlab cannot handle. The
vector is 984*1. For some reason it does not compute the
sum, the mean or the variance. To the command
nonzeros(DEF==NaN) it responds with an empty matrix, so it
seems like everything is a number. Also, Excel can handle
the data without any problems. Can somebody please tell us
what could be the problem? Thank you very much.
Sincerely,
Kadek and Floris
Sorry, but testing for an element equal to NaN
must be done using isnan. You don't believe
me?
[1 NaN 3 NaN 5 6] == NaN
ans =
0 0 0 0 0 0
However,
isnan([1 NaN 3 NaN 5 6])
ans =
0 1 0 1 0 0
So Matlab can indeed handle this vector. You
do need to write the correct code.
John
.
- Follow-Ups:
- Re: Data vector
- From: Floris Zoutman
- Re: Data vector
- References:
- Data vector
- From: Floris Zoutman
- Data vector
- Prev by Date: Re: pls help me out
- Next by Date: Re: slow save -append for mat files
- Previous by thread: Data vector
- Next by thread: Re: Data vector
- Index(es):
Relevant Pages
|