Matlab Knot

As much as I love OpenSCAD, constructive solid geometry is just not efficient at certain tasks and I got tired of waiting for hundreds of spheres to be unioned and rendered to make a knot. This is a parametric Matlab script to do the same thing as MakeALot's script, but in seconds instead of hours, plus the mesh is smoother.
The [3,1] knot I printed required more material for support than the print did, but it came out nice in the end. I designed it to fit a 12.7mm steel ball I had extras of from a Geomag set. Since the knot is toroidal, the ball freely rolls around the inside without falling out.
I included a couple of other example knot STLs in case you can't run the script.