Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!m44g2000hsc.googlegroups.com!not-for-mail
From: Ian Taylor <robert.ian.taylor@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Integrating function of a function
Date: Fri, 20 Jun 2008 06:01:44 -0700 (PDT)
Organization: http://groups.google.com
Lines: 18
Message-ID: <39e38ef4-9894-45c8-9b17-e264ccf03233@m44g2000hsc.googlegroups.com>
NNTP-Posting-Host: 134.146.0.42
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1213966904 12778 127.0.0.1 (20 Jun 2008 13:01:44 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 20 Jun 2008 13:01:44 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: m44g2000hsc.googlegroups.com; posting-host=134.146.0.42; 
User-Agent: G2/1.0
X-HTTP-Via: 1.1 DS, 1.1 US
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 
Xref: news.mathworks.com comp.soft-sys.matlab:474953



I have a function (let us call it shape), and one example I could use
for this is:

shape = hmin + x*x/(2*R)

so there are three input arguments: x, hmin, R

I want to integrate 1/(shape*shape) and 1/(shape*shape*shape).
I'm having trouble with the syntax needed to do this with quad.

I know that if I simply wanted to integrate shape, I would use
quad(@(x)shape(x,hmin,R),a,b)

Is it best to define two functions, one being 1/(shape*shape) and the
other being 1/(shape*shape*shape), or can I call quad directly in some
way ?

Thanks