Maths Lecturer at Massey University. Working on high performance computing and modelling.
Professional Interests: numerical analysis, modelling, computer vision, mathematical biology

Yeah, I tried all sorts of ways to do that too! I was trying to figure out a better way to normalise the matrix. I discovered normr, posted my solution, and then realised that it was actually a toolbox function. I'd be happy to have that entry removed :| If you replace the normalisation line with normr(diff(P)) you can get the 36