Added Matlab 6.5-compatible