clear all; Z=[0 0 0 0 0 0 0 0 0 20 0 0 0 0 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; X = [1:6]; Y = [1:5]; v = [1 5 10 15 20]; figure('visible','off'); [C,h] = contour(X,Y,Z,v); clabel(C,h); xx = C(1,:); yy = C(2,:); R = C'; [rowCount,colCount] = size(R) fid = fopen('f:\aaa.txt','w'); for row=1:rowCount fprintf(fid,'%g ',R(row,:)); fprintf(fid,'%s\r\n',''); end fclose(fid);