Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

precission/accuracy in mathlink for excel

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53332] precission/accuracy in mathlink for excel
  • From: "plizak" <plizak at gmail.com>
  • Date: Thu, 6 Jan 2005 02:52:13 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

I have some code running in a spreadsheet on a M-code worksheet in
excel.

I can call the code in either a VBA macro or in a cell, but it only
returns four digits of accuracy.  Yet when I run it in a notebook in
Mathematica I get more precision.

Is there a way to get more precision?


Here's what I've been doing...

In Excel I use
=Math("mainModule[ 5, {38357, 60, 10000000, 100, 40183, 442600., 1000,
0.05, 0.1, 1}, {10, 20, 30, 40, 50}, {0.4, 0.4, 0.4, 0.4, 0.4} ]")
and the output is
{212500., 630400., 417800., 0.02126, 150.9}

In Mathematica notebook I use
mainModule[ 5, {38357, 60, 10000000, 100, 40183, 442600., 1000, 0.05,
0.1, 1}, {10, 20, 30, 40, 50}, {0.4, 0.4, 0.4, 0.4, 0.4} ]
and the output is
{212553., 630363., 417810., 0.0212553, 150.873}

alternatively I can enter
result = Application.Run("Mathematica", "mainModule", _
ActiveWorkbook.Sheets("Input Screen").Range("B17"), _
ActiveWorkbook.Sheets("Input Screen").Range("B7:B16"), _
ActiveWorkbook.Sheets("Input Screen").Range("B21:B25"), _
ActiveWorkbook.Sheets("Input Screen").Range("C21:C25"))

result = Application.Run("Mathematica", "N[ mainModule[ N[#1], N[#2],
N[#3], N[#4] ] ]", _
ActiveWorkbook.Sheets("Input Screen").Range("B17"), _
ActiveWorkbook.Sheets("Input Screen").Range("B7:B16"), _
ActiveWorkbook.Sheets("Input Screen").Range("B21:B25"), _
ActiveWorkbook.Sheets("Input Screen").Range("C21:C25"))

in a macro and get the same results as if it were directly in an excel
spreadsheet, {212500., 630400., 417800., 0.02126, 150.9}.
Thanks for any help in advance!
Peter


  • Prev by Date: Re: DisplayTogether has stopped working
  • Next by Date: Re: Partial evaulation of function terms
  • Previous by thread: Debian Woes
  • Next by thread: Re: precission/accuracy in mathlink for excel