Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #12422
| From | "Nasser M. Abbasi" <nma@12000.org> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: question about NIntegrate |
| Date | 2012-11-23 08:29 +0000 |
| Message-ID | <k8nc51$dft$1@smc.vnet.net> (permalink) |
| References | <k8krhj$83k$1@smc.vnet.net> |
| Organization | Time-Warner Telecom |
On 11/22/2012 3:33 AM, dsmirnov90@gmail.com wrote:
> Hi,
> Clear[f]
> f[(a_)?NumericQ] := {a^2};
> NIntegrate[f[x], {x, -1, 1}]
>
> I get an error: "Integrand f[x] is not numerical at {x} = {-0.984085}"
>
do not make the result of f a List. i.e. remove the {}
---------------------------------
Clear[f]
f[(a_)?NumericQ]:=a^2;
NIntegrate[f[x],{x,-1,1}]
-------------------------------
Out[50]= 0.666667
--Nasser
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
question about NIntegrate dsmirnov90@gmail.com - 2012-11-22 09:33 +0000 Re: question about NIntegrate "Nasser M. Abbasi" <nma@12000.org> - 2012-11-23 08:29 +0000
csiph-web