Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: quad2d sfit
Date: Thu, 17 Sep 2009 13:09:53 -0400
Organization: The MathWorks, Inc.
Lines: 41
Message-ID: <h8tqgj$cl5$1@fred.mathworks.com>
References: <h8tmp9$4ic$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1253207379 12965 172.31.44.65 (17 Sep 2009 17:09:39 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 17 Sep 2009 17:09:39 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:571159



"Aaron " <macraiga@gmail.com> wrote in message 
news:h8tmp9$4ic$1@fred.mathworks.com...
> Hi All,
>
> I am looking to integrate the area under a surface fit. I searched for a 
> method to do this and found a page on qyad2d
> http://www.mathworks.com/access/helpdesk/help/toolbox/curvefit/index.html?/access/helpdesk/help/toolbox/curvefit/quad2d.html
>
> which claimed the function quad2d will "Numerically integrate sfit object"
>
> However when I try to run it I get the error message
>
> "First input argument must be a function handle."
>
> Can anyone explain to me why this is happening, do I need a more recent 
> version of Matlab?

The QUAD2D method for surface fit (sfit) objects was introduced in version 
2.1 of Curve Fitting Toolbox, which was part of release R2009b.

http://www.mathworks.com/access/helpdesk/help/toolbox/curvefit/rn/br5i38t-1.html

If you're using an older version of the toolbox, MATLAB interprets that code 
as a call to the QUAD2D _function_ which expects its first input to be a 
function handle.  As a workaround, write:

quad2d(@(x, y) mySFITobject(x, y), lowerXlimit, upperXlimit, lowerYlimit, 
upperYlimit)

making the obvious substitutions.

If you are using this version of the toolbox, post how you're calling QUAD2D 
on the sfit object.

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ