The Math 692 one-page Matlab FEM code challenge

Ed Bueler, version 5/8/05

Write a Matlab code to solve a PDE (or closely related) problem by (some variant of) the FEM.

The code must fit on one page.  Specifically, let's say that a page is 60 lines and each line is at most 90 characters.   Documentation and comments are encouraged and they do not count in the one-page limit.

One is allowed to use any part of standard Matlab 7.0 or earlier.  The codes may build upon each other; codes may use any code which has already been submitted (see the list below).  Furthermore, input functions can be built as needed at the command line (anonymous or "inline" ).   One must be reasonable in what needs to be built at the command line to run the program.  One is not allowed to call FEMLAB or other major toolboxes.

Submissions should be sent by email to Bueler:     Multiple entries are encouraged.  One need not be officially registered for Math 692 or even be affiliated with UAF to be eligible.

The tool which motivated this challenge was a one page mesh generator which appeared in SIAM Review this year.  In fact, the challenge is only feasible with such a program.  The entries below all suppose that the   distmesh  collection of m-files is available in Matlab.  Go to
to download these codes.

NOTE January 2014: All the codes below are now hosted at
Thus the links below are all broken.



The following do not conform to the rules in various ways, but are interesting none-the-less: