Watch this Author's files
There is an error in the code line 45. The bug can be fixed by substituting it by:
fprintf(fid,'13\n %.4f\n 23\n %.4f\n 33\n %.4f\n',X(i+1,j),Y(i+1,j),Z(i+1,j));
You can fix the error by editing and re-uploading the file.