Re: Data vector



"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
.



Relevant Pages

  • Re: Data vector
    ... the mean or the variance. ... To the command ... ==NaN is not nice, ... Empty matrix: 0-by-1 ...
    (comp.soft-sys.matlab)
  • Re: State of Forth 200x
    ... speaking of, who wish to get involved to the extent of understanding some Forth plus application words and tinkering with the program, even though they don't think of themselves as professional programmers. ... A major weakness of ANS Forth is that it is really two different languages, unlike, say, the Unix shell. ... However, I find with both types of users, a command that will commonly be typed with one or more parameters should check those parameters for reasonableness. ...
    (comp.lang.forth)
  • Hiding a field in Access 2000 using "Code Builder"
    ... Im am trying to hide a field on a Access Form, but assign a command button ... Private Sub Command135_Click ... Dim Password As String ... Dim ans As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Find is not working correctly
    ... Ken Davis wrote: ... Empty matrix: 1-by-0 ... Is there a fix? ...
    (comp.soft-sys.matlab)
  • Re: Find is not working correctly
    ... Empty matrix: 1-by-0 ... Is there a fix? ... this is NOT a bug. ...
    (comp.soft-sys.matlab)