MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

NIntegrate a COM Object

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55001] NIntegrate a COM Object
  • From: wuf at northwestern.edu
  • Date: Wed, 9 Mar 2005 06:34:26 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

I'm trying to NIntegrate a COM object in Excel.  As a simple example,
the following won't work

>> Needs["NETLink`"]
>> excel=CreateCOMObject["Excel.Application"]
>> excel@Visible=True
>> excel@WorksheetFunction@Tanh[2]
>> Tanh[2.0]

The last two commands match exactly.  Now I want to NIntegrate them.

>> NIntegrate[Tanh[x],{x,-1,2}]

works but

>> NIntegrate[excel@WorksheetFunction@Tanh[x],{x,-1,2}]

retruns with the following error:

NET::methodargs : Improper arguments supplied for method named Tanh
NIntegrate::inum : Integradn $Failed is not numerical at {x}={0.5}.

However, the following Plot command works on the COM object

>> Plot[excel@WorksheetFunction@Tanh[x],{x,-1,2}]

What's going on here and more importantly, how can I get NIntegrate to
work with the COM object?

Thanks
Frank


  • Prev by Date: Nested iterators in Compile
  • Next by Date: String comparison
  • Previous by thread: Re: Nested iterators in Compile
  • Next by thread: String comparison