Mathematica 9 is now available

How Do I Export Mathematica Results to Other Programs?

There are numerous ways of exporting results, graphics, and code from Mathematica to other programs. They range from simple copy and paste to generation of web animations to creating stand-alone C++ code.

Using Copy and Paste

On most computer platforms, Mathematica text, formulas, and graphics can be copied and pasted using the standard clipboard. The quality and format you end up with is sometimes limited by the underlying operating system, the target application, or the window manager. Information on some specific platforms and programs is provided below.

Microsoft Windows 95/98/Me/NT/2000

Mathematica for Microsoft Windows allows graphics and typeset expressions to be copied as bitmaps or in Metafile format. Text can be copied as plain or formatted text. In some cases, copying and pasting text will cause formatting information to show up in the target application. To get rid of this formatting code, copy the text again using Copy As->Plain Text. In some programs like Microsoft Word, some of the formatting and special characters are preserved, but keep in mind that not all typesetting in Mathematica is supported by other programs.

Export Higher-Quality Graphics to Word or PowerPoint

Using something like Display["graph.wmf", Plot[Cos[x], {x, 0, 2Pi}], "Metafile"] to generate your graphic and importing graph.wmf into Word have the same effect.

Copy and Paste Numbers between Mathematica and Excel

Wolfram Research provides Mathematica Link for Excel, a general link between Mathematica and Excel. Part of its functionality is enabling users to copy and paste data between the two applications.

Alternatively, you can use Import and Export in combination with Excel's SaveAs and Open commands to read and write tab-delimited tables.

Return to Top

Using the Export Command

Export and Import provide a general mechanism for getting data into and out of Mathematica 4. For more information on these functions, supported formats, and options, please read the documentation for these Mathematica functions and Sections 1.11.3, 2.9.20, 1.11.5, 2.9.19, and 2.11.7 of The Mathematica Book. In certain special cases, some other functions and standard packages like ReadList, Read, Write, or BinaryFiles might also be helpful. For operations on binary files, take a look at the experimental binary packages described in Appendix 15.1 of The Mathematica Book.

Return to Top

Generate C, C++, or Fortran Code

Simple Translations

For simple algebraic expressions, the two functions CForm and FortranForm create the C or Fortran equivalent of the Mathematica expression. See the following example.

        x**2 + 2*x*Sqrt(y) + y
        Power(x,2) + 2*x*Sqrt(y) + y

Generating Code from Mathematica Expressions, Functions, and Programs

Wolfram Research, Inc. is distributing MathCode C++, an application package that can compile Mathematica expression and programs into C++. MathCodeC++ can also work with compilers to generate either stand-alone code or code modules that can be linked back into Mathematica. More information on MathCode C++ is available.

Return to Top

Creating PDF Files from Mathematica Notebooks

For information on creating PDF files from Mathematica see the How-to How Do I Create PDF Files from Mathematica Notebooks?

Return to Top