This was really what I need to solve my problem with fwrite that works to slow hen multiple precision is needed (similar to the problem presented here: http://www.mathworks.de/matlabcentral/newsreader/view_thread/94508)
Nobugs found (yet).
I like this code and I'm using the simulation within it as a to make an evolutionary nural network controler for a Khepera robot. For now on I found one bug:
In rangefinder function [dimy, dimx] = size(course); should be [dimx, dimy] = size(course); . It's not important for symmetrical PNG's but for nonsimetrical the robot is able to go through walls - nice but not desirable.