New in Wolfram Mathematica 8: Integrated C Workflow  previous  |  next 

Software Development

Create Standalone Executables Using Compiled Functions 

You can generate and distribute standalone executables.
In[3]:=
Click for copyable input
X

Start by defining a function or functions of interest.

In[1]:=
Click for copyable input
X

Generate C code and a header.

In[2]:=
Click for copyable input
X
Out[2]=

Write a C main function to call the generated code.

In[4]:=
Click for copyable input
X
Out[4]=

Compile it into an executable using the Wolfram Runtime Library.

In[5]:=
Click for copyable input
X
Out[5]=

Now you can distribute the program and run it outside of Mathematica. You can also run it inside Mathematica to test and demonstrate it. Set up an input signal with several frequency components.

In[6]:=
Click for copyable input
X
Out[6]=

Convert the input signal to the file format that the executable expects.

In[7]:=
Click for copyable input
X
Out[7]=

Run the executable, parse the output, and plot the original signal (blue) with the low-pass filtered signal (red).

In[8]:=
Click for copyable input
X
Out[8]=