MathPad XFuns
XFuns are plug-in modules that can be used to extend MathPad's capabilities. This page lists XFuns available for version 2.5 and earlier. (Last updated 11-27-00).

These XFuns will not work with MathPad version 2.6

To download XFuns, you may need to set your browser's helper application for macbinary ".bin" files to use Stuffit Expander.

To add an XFun, drag the file into MathPad's "Active XFuns" folder. If MathPad is already running, you must quit and re-launch it to see the XFun. The XFun will be added to the Functions menu and it may also add entries to the Help menu. Adding XFuns will increase MathPads memory needs. Use the Finder's get info box to increase MathPad's memory size.


The following XFuns have been added or updated since the 2.5.2 release:

SVD [get]
Linear algebra tools using singular value decomposition. These XFuns are considerably faster and more accurate than using the det() function. Version 1.1 (11-27-00) fixes a possible crash bug for undefined array elements.
-- solve(A,B) solves a system of linear equations A*X = B
-- invert(A) finds the inverse of matrix A
-- SVD(A) returns the decomposition arrays

imageRGB2 [get]
imageRGB(rgbarray,pixsize) Allows direct specification of the red, green and blue color components of each image element. imageRGB2 is a replacement for imageRGB from the 2.5.2 distribution. It allows the choice of either 16-bit or 32-bit pixels.

AEvents3 [get]
Custom AppleEvents for scripting MathPad. AEvents3 should be used instead of the AEvents2 from the 2.5.2 distribution.
This fixes an error in the dictionary resource so that the "copy plot" and "save clipboard" events are now recognized by AppleScript.


The following XFuns are not included with the 2.5.2 release:

contour [get]
contour(array,nlevels,min,max) draws a contour plot given a 2D array.

readspice [get]
readspice(fname,signame) extracts data from an output file created by the SPICE3f4 circuit simulation program. (SPICE3f4 is freeware available at info-mac).

erf [get]
erf(x) returns the error function (integral of exp(-t^2) from 0 to x). (If you have a PPC use the gammaPPC XFun instead)

The archive sendAE contains a utiltiy C routine for running MathPad via AppleEvents from another application. This allows you to "call" MathPad from a C program.


The following XFuns are included with the 2.5.2 release but are not included in the 2.4.7 release:

readsnd [get]
Sampled sound routines.
-- readsnd("fname") reads in a system 7 sampled sound file.
-- writesnd("fname",samples,rate,bits) writes a system 7 sampled sound file.
-- playsnd(samples,rate,bits) plays an array as a sampled sound.

Version 1.1 (4-13-98) adds the capability to use 16-bit sounds. Version 1.2 (4-13-00) has lower memory requirements.

QTmovie [get]
movie(fname,nframes) saves a sequence of plots as a QuickTime movie.

Version 1.0.2 (2-22-98) fixes a compatibility problem with older 68K macs.

progressbar [get]
progressbar(percent) can be called repeatedly during a long calculation to display a window with a progress bar and an estimate for time remaining.

AEvents1 [get]
Custom AppleEvents for scripting MathPad. Documentation and an 'aete' resource are included.
AEvents1 (6-9-97) is for use with MathPad 2.4.7 only.
AEvents3 (6-5-00) is required for MathPad 2.5.2

readxy [get]
readxy(fname,skip,npts) reads coordinates and labels from a delimited text file. (Archive fixed 7-1-97).

sizeaxis [get]
sizeaxis(xpix,ypix) changes the plot window size to get a specific data axis size or aspect ratio. Can be used to force a square data display coordinate system.

showPICT [get]
showPICT(fname,left,bot,width,ht) reads a PICT file and displays it as a data plot overlay.

viewsurf1 [get]
viewsurf(zgrid,plotflag) displays a projection of a 3D surface. This is the same as the viewsurf XFun included with MathPad 2.4.4 except for a minor upgrade. It now updates the plot while the thumb button is being moved.

GetTime [get]
System date time routines.
-- GetTime(0) returns the current date time {yr,mo,day,hr,min,sec}
-- Date2Secs(date) converts {yr,mo,day,hr,min,sec} to seconds since 1904
-- Secs2Date(secs) converts seconds since 1904 to {yr,mo,day,hr,min,sec}

ticks [get]
ticks(0) returns the current system tick count. Can be used for timing comparisons.

histo2D [get]
histo2D(xarray,xlo,xhi,xbins,yarray,ylo,yhi,ybins) accumulates a 2D histogram of the x y values in the arrays.

fft [get]
Discrete Fourier transform routines.
-- fft(C) transform of a complex array.
-- invfft(C) inverse transform.
-- rfft(R) transform of a real array. (bug fix 3-29-97)
-- pwrspec(R) power spectrum estimate of a real array.


MathPad main page