[X,Y,Z] = peaks; figure A=contour(X,Y,Z,20); % shapewrite(A,'contour.shp')
x = A(1,:) ; y = A(2,:) ; Data = struct([]) ; % initilaize structure for i = 1:length(x) Data(i).Geometry = 'Point' ; Data(i).X=x(i) ; % x value Data(i).Y =y(i) ; % y value Data(i).Name = randseq(1) ; % some random attribute/ name end shapewrite(Data, 'myfile.shp')