http://www.mathworks.com/matlabcentral/newsreader/view_thread/53969