Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: detect NaN in a matrix
Date: Sun, 5 Jun 2011 21:40:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 13
Message-ID: <isgt3k$gib$1@newscl01ah.mathworks.com>
References: <isgrf4$cto$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1307310004 16971 172.30.248.45 (5 Jun 2011 21:40:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 5 Jun 2011 21:40:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:730333

"pink" wrote in message <isgrf4$cto$1@newscl01ah.mathworks.com>...
> .........
> elseif isempty(data)|| isnan(data)
>     warndlg ('Ceck Data ','warning!!!')
>    else
>   end 
> 
> ??? Operands to the || and && operators must be convertible to logical scalar
> values.
- - - - - - - -
  You need to use | and & rather than || and && with vectors such as you have here.  The latter operators are only to be used with scalar quantities.  Of course, the logical results will be vectors too, so you will have to use such functions as 'any' or 'all' to use the results in 'if' statements such as you give in your example.

Roger Stafford