MathGroup Archive 2005

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

Search the Archive

calling a C executable from within Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60485] calling a C executable from within Mathematica
  • From: "Steven Taracevicz" <sftara at starshooter.com>
  • Date: Sat, 17 Sep 2005 02:32:30 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello:

Would someone please help me with the function call within Mathematica?

I would like to use a C program within Mathematica.

Here is what the program looks like when run under a DOS window. I have 
included some paratheses where I comment.



E:\Analysis>simulation5.ext  alpha.txt params.txt output.txt


5 rows of data read from alpha file.


enter level of temp, volatility, 100 year mean, thermal coefficient
63 .2 3.6 1.2

(entered with spaces)

what percent is man-made carbon effect? 12

threshold (%)? 95

how many simulations? 9999

average number of years between 20%, 15%, 10%, and 5% peturburances? 50 25 
15 5

(entered with spaces)


here is the alpha text file that is located in the same directory as the C 
executable:

60 .20
61 .23
62 .25
63 .29
64 .33

Here is the params text file that is located in the same directory as the C 
executable:

1000000.0
  0.0
  4.58
  0.0
  2.0
  99.0
  85.0
  10.0 15.0
  2.0
  50.0
  20.0
  10.0 20.0

We can change the input/output code in the C code to best suit Mathlink.

Thanks in advance.

Cheers,
Steve


-- 
Steven Taracevicz
310.749.6666 cell
702.355.6396
310.388.3265 fax



  • Prev by Date: Extracting coefficients for sinusoidals
  • Next by Date: Re: Complete solution to a modular System of equations
  • Previous by thread: Re: Extracting coefficients for sinusoidals
  • Next by thread: Re: calling a C executable from within Mathematica