MATLAB: Mesh plot with only every nth line plotted

3-d plotmeshnth line

Hello,
is it possible to reduce the number of plotted lines in a mesh-plot without loss of accuracy? I know, I can reduce the number of data points. But in this case the accuracy of the mesh-plot gets quite bad (see exsample below). Is there any way to say "mesh" to show only every nth line of the wireframe?
% [Matlab]
[DataX,DataY,DataZ] = peaks(100);
subplot(1,2,1);
mesh(DataX,DataY,DataZ,'EdgeColor','k');
subplot(1,2,2);
mesh(DataX(1:10:end,1:10:end),DataY(1:10:end,1:10:end),...
DataZ(1:10:end,1:10:end),'EdgeColor','k');
% [/Matlab]
Best regards
Guido
[Edit] Really bad mistake in writing corrected. [/Edit]

Best Answer

There isn't a nice automatic way to do it, but it's not too hard. You need 3 surfaces. One for the white background, one for the row edges, and one for the column edges. It would look something like this:
rskip = round(linspace(1,size(DataZ,1),32));
cskip = round(linspace(1,size(DataZ,2),32));
surf(DataX,DataY,DataZ,'FaceColor','white','EdgeColor','none');
hold on
surf(DataX(rskip,:),DataY(rskip,:),DataZ(rskip,:),'FaceColor','none','MeshStyle','row');
surf(DataX(:,cskip),DataY(:,cskip),DataZ(:,cskip),'FaceColor','none','MeshStyle','column');
hold off
The reason for this is that you want to reduce the resolution between edges, but not along edges.