a= peaks(1000); h = surf(a) set(h, 'edgecolor','none')
5 CommentsOldest to Newest
shading flat, shading interp, shading facetedcommands. They take care of greater number of objects automatically, but internally use similar commands you presented in the video. Regards, Petr
Note that I added a small value to the aa matrix. This is because if left alone the net will have patches that are blocked by the surface, mainly at the peaks. Of course it makes the underside of the surface look worse in this regard, but as I said, I use this technique to get a static image for publication/presentation purposes.
a = peaks(1000); opengl software h = surf(a); set(h, 'edgecolor','none') hold on x = 1:1000; k = [1 0:20:1000]; % The values to keep. k(2) = ; st = setxor(x,k); x(st) = NaN; % Set most values so they won't plot. [xx,yy] = meshgrid(x); idx1 = isnan(xx)|isnan(yy); a(idx1) = NaN; idx2 = ~isnan(xx)&~isnan(yy); xx = reshape(xx(idx2),51,51); % Reshape these guys. yy = reshape(yy(idx2),51,51); aa = reshape(a(idx2),51,51); m = mesh(xx,yy,aa+.04); % Create the net. set(m,'edgecolor','black','facealpha',0,'linewidth',1) set(1,'units','normalized','position',[.05 .05 .85 .85])