Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: logical scalar values input
Date: Mon, 25 May 2009 15:36:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <gvedt1$f1n$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1243265761 15415 172.30.248.38 (25 May 2009 15:36:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 25 May 2009 15:36:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1244042
Xref: news.mathworks.com comp.soft-sys.matlab:542402

Hi,

i wrote the following piece of code:

if (isnan(A) || isnan(B) || isnan(C) || isinf(A) || isinf(B) || isinf(C))
    value_chk=1;
else
    r = roots(p); %%computing roots of the equation inorder to find the refractive index
    [root_size rr]=size(r);
end

now i am getting these values although A=B=C are matrices of 1 or 0

??? Operands to the || and && operators must be convertible to logical scalar values.
Bye