Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: fzero  logical error
Date: Tue, 11 May 2010 21:25:19 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <hschvv$lor$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1273613119 22299 172.30.248.35 (11 May 2010 21:25:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 11 May 2010 21:25:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2254732
Xref: news.mathworks.com comp.soft-sys.matlab:634789

I have problem running for the first time, the below function but when I run it again it works fine. I am unable to trace out the error. 

I am solving for 'y' and all others are defined. 
For instance, if y is the variable, then: 

x =100; 
Peri = 1e4; 
rhoc = 4.5 
ficrho = 0.9; 
g = 9.81; 
Fun=@(y)(x/(Peri)-(rhoc*(rhoc-ficrho)*g*(y)^3)); 
options=['iterations','100','tolX','0.01']; 
Fdel=fzero(Fun,1.4766*10^-5,options) 

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

Error in ==> fzero at 333 
elseif ~isfinite(fx) || ~isreal(fx) 

Error in ==>Fun=@(y)(x(4)/(Peri)-(rhoc*(rhoc-ficrho)*g*(y)^3)/; 

Can you please let me know how can I control this and tried to fix it but it doesn't work. 

Thank you for your consideration. 

Regards, 
VJ