Programming

by

In order to display text in a processing applet or sketch, one needs to first create a font to use with your sketch. Select Tools > Create Font… from the menu. The dialogue box shown below will appear (Mac OS X version of IDE) select the font and font size and specify the name of

by

The extension EPS stands for Encapsulated PostScript and is my favorite filetype for graphics and figures I produce using applications like Illustrator, Inkscape, and MATLAB. Here is how to insert EPS figures into a LaTex document. First you have to use the graphicx package so insert the following after the \documentclass tag and before the

by

Below is code demonstrating how to typeset matrices in LaTeX using the array environment. \begin{displaymath} Q = \left( \begin{array}{ccc} q_{11} & q_{12} & q_{13} \\ q_{21} & q_{22} & q_{23} \\ q_{31} & q_{32} & q_{33} \\ \end{array} \right) \end{displaymath} The code generates a three column matrix with the contents of each column centered ({ccc}).

by

For a recent project one of my research students needed to generate exponentially distributed random numbers in MATLAB. The Statistics Toolbox has a built-in function to do this, but I don’t have a license for this toolbox. Below is the code we wrote. It performs a log transformation to convert a uniformly distributed random number

by

It is possible, and only slightly awkward, to make LaTex tables with borders around some of the cells and no borders or only partial borders around other cells. Below are two snippets of code showing you how. Each is followed by an image of the table it produces. This code uses two LaTex packages, multirow