Sample WalkThrough
A dialog box pops up that allows you to select if you want to connect to a kernel that was previously launched
from the Mathematica front end (so that the two front ends can share the same kernel and thus exchange
symbols and data) or if you want to launch a new kernel for Calc.
(For more information on the kernel sharing options in CalcLink with schematic diagrams
visit Kernel Sharing Options.)
Linux (Fedora 10 with Gnome and Glider theme)  Vista 


If you choose "New Kernel" you will get a popup that allows you to specify the kernel you want to use. In most cases you will probably just want to accept the default location of the kernel file.
Linux (Fedora 10 with Gnome and Glider theme)  Vista 


Linux (Fedora 10 with Gnome and Glider theme)  Vista 


All CalcLink functions are browsable from the function wizard in Calc (all functions beginning with "Eval" below are CalcLink functions).
Also all Mathematica symbols (functions, options, attributes) are browsable from CalcLink. You can just press the button "Show Symbols" on the control planel or type "=showsymbols()" in a Calc cell, and you will get a popup with all Mathematica symbols along with their values.
The filter text field lets you quickly find the Mathematica symbols you are looking for. As you type, the list of symbols is narrowed down to those that match the strings you have typed so far. This happens instantly and "live" in front of your eyes (even Mathematica doesn't have this feature).
The following shows all Mathematica symbols that contain "NS". 
This shows all Mathematica symbols that contain "Pi". 


This shows all hypergeometric functions in Mathematica. 
These are all Mathematica symbols that contain "Contour". 


The pattern matching uses standard Perl 5 pattern matching / regular expression syntax, so you can use "\" as an escape character.


This shows all Mathematica symbols that end with "Plot". 
This shows all Mathematica symbols that contain "Plot" but don't begin with "L". 


The CalcLink function evalrange lets you pass a range definition to specify the data to be used as input. Selecting a range in the worksheet, Calc highlights the selection with a red border and updates the cell range in the argument of evalrange as you drag the mouse. Here we pass a 3 x 3 matrix as an argument to Mathematica's determinant function.
Upon hitting "Enter", you instantly get the determinant of the matrix. (As a sidenote, all elements in the matrix are integers, and CalcLink ensures that the data is passed to the Mathematica kernel as integers, and therefore the return of the Det function is an integer again. This is the Dynamic Type Detection feature of Mathematica. CalcLink then submits the result back to Calc as an integer!)
CalcLink fully supports array formulas. The inverse of a nonsingular 3 x 3 matrix is a unique 3 x 3 matrix again, and you compute it with CalcLink by selecting the destination cells, entering the appropriate CalcLink function, ...
... and upon hitting Ctrl+Shift+Return you instantly get the inverse matrix, placed in the cell range you selected.
Notice that the display in the Calc spreadsheet shows decimal numbers here. The inverse of an integer matrix is usually not an allinteger matrix again. Mathematica and CalcLink use rationals internally throughout, but as Calc itself can only display decimal numbers and not fractions, the display in the Calc worksheet has to be in decimals. All computations in Mathematica and CalcLink remain entirely rational and thus incur absolutely zero roundoff error internally! Only the final display step incurs the conversion to decimals, never any computation!
With the same method we now compute the eigenvalues of the matrix. A nonsingular 3 x 3 matrix has exactly 3 unique eigenvalues. We select the destination cell range first, enter the CalcLink function, ...
... and then hit Ctrl+Shift+Return and instantly get the three eigenvalues corresponding to the matrix.
Here we compute the three eigenvectors of the matrix. A nonsingular 3 x 3 matrix has exactly 3 unique (up to normalization) eigenvectors pertaining to its 3 unique eigenvalues. Selecting the destination cell range, entering the formula ...
... and upon hitting Ctrl+Shift+Return we instantly get the three eigenvectors placed in the destination cells specified.
CalcLink lets you pop up windows with Mathematica graphics from a spreadsheet cell. Here we generate a bar chart display with Mathematica's BarChart command. Notice that the Mathematica expression used in the CalcLink function evalplotrange is just the familiar Mathematica code that we'd use in the Mathematica frontend, except when using data that is specified by using a cell range definition, we submit the expression as a pure function.
This creates a new window with a bar chart display (using 3d effects settings that are new in the Mathematica 7 kernel) of the number of days of the months and gives it a title and uses default settings for window height and width.
A new window pops up displaying the Mathematica bar chart graphics.
Unlike OpenOffice charts, the graphics are not embedded in the Calc spreadsheet, they are new popups and therefore can be freely moved around on the desktop.
CalcLink also has a simple frontend of its own. Its features are far inferior to the full Mathematica frontend, but it can be conviently used as a "scratch pad" frontend that consumes much less memory than the full Mathematica frontend while retaining full interactivity and connectivity with the Calc spreadsheet.
The CalcPad can be launched from a spreadsheet cell with the CalcLink function called "calcpad". When submitting "=calcpad()" from a spreadsheet cell the CalcPad pops up.
The default behavior of CalcLink is to use the SAME kernel for the Mathematica function calls submitted from Calc cells and the CalcPad (this can be changed by the user). Thus, function/symbol definitions can be made on "both sides" of the kernel, it effectively allows the user to share expressions between the two.
Here we define a variable "myvariable" from a Calc spreadsheet cell and assign the value 45.6 to it.
As we type the variable name in the CalcPad, we request its value.
Likewise, we can set up a symbol definition in the CalcPad ...
... and request its value from a spreadsheet cell ...
... and we get its value, previously defined in the CalcPad.
In Mathematica all expressions are hierarchical, treelike structures. CalcLink provides an interactive expression viewer for any Mathematica expression to make it easier to understand deeply nested expression trees. Every node can be expanded or collapsed, allowing the user to interactively study only those parts of the expression tree that are of interest.
a+b+c+d+Pi A simple expression, only one nesting level 
HornerForm[x^5+x^4+x^3+x^2+x+1]. Every node has a nesting level. 


Plot3D[Sin@x Cos@x,{x,Pi,Pi},{y,Pi,Pi}] A very deep structure generated by Plot3D 
Series[Tan@x,{x,2,6}] A moderately deep structure generated by Series 


CalcLink provides a convenient windowcopy function. By simply rightclicking (or centerclicking or pressing the mousewheel) a new window is created containing an identical copy of the contents of the original window.
The original: Plot[Tan@x,{x,Pi,Pi},PlotStyle>Red]  The copy: 


The CalcPad displays all graphics and typeset output exactly the way the Mathematica frontend would (as the latter is used as a service to the kernel that is being used). Notice the vertical lines at the poles, the fonts used in the tick labels, and the tick marks. Also notice the colorcoding of the Mathematica expression (however, that is different from the colorcoding used by the Mathematica frontend and can be fully customized in the menus of the CalcPad along with bracketmatching behavior.).
CalcLink supports most free and commercial LookandFeels, standard and from thirdparty providers.
Nimbus  Standard/Ocean  JGoodies Plastic 3D 



Visual Studio 2005  JGoodies Windows  JGoodies Plastic XP 



Nimrod  Squareness  Tonic 



Copyright © 2008 Andreas Lauschke Consulting. All Rights Reserved.