function q=mmhole(x,y,z,xlim,ylim)$ c) [2 J d) T O; J( n0 ^
%MMHOLE Create Hole in 3D Graphics Data! A4 P( X1 D' K' I
% Z=MMHOLE(X,Y,Z,Xlim,Ylim) sets the data in Z to NaN! Q; w0 w! y9 P. r* e# S
% corresponding to the limits in Xlim=[Xmin Xmax] and 9 F9 F- L) k0 f$ N; H8 c. X% Ylim=[Ymin Ymax]. If Xlim or Ylim are empty they are ( e& u5 K- m3 b+ }% assumed to be [-inf inf]. ! D3 K! d3 a) g+ }8 o, w% X and Y can be plaid matrices, e.g., created by MESHGRID 8 y* F/ U' j# M! ^ B# y% or they can be vectors defining the x and y axes. # L% Q" r {" c2 d/ k% + i# X+ | M5 ?$ u3 F* X% Z=MMHOLE(Z,Clim,Rlim) creates the NaN hole based on the : R. H# a( p. G/ c* _
% column index limits in Clim and the row index limits in Rlim * R9 S" C1 c$ }$ ~5 p% 5 {3 V! h$ ]5 i ]: E& `1 Y4 X$ O% Resulting data can be plotted using mesh or surf: ! ~( d1 H/ i; A; r [% MESH(X,Y,Z) or SURF(X,Y,Z) , S( ~; N! Z1 e5 P% H' w% This function automates the procedure described on * I! V" t2 f" F; ]+ ^! p3 f. ?% page 249 of "Mastering MATLAB".+ q5 b' Z4 D0 Z; P! l
; c0 @8 A$ D) f( X
% D.C. Hanselman, University of Maine, Orono ME, 04469 - D- K @; l/ ]" Q/ }; V7 U2 j% 9/26/958 X) A( M( m# S" U8 a% `
% Copyright (c) 1996 by Prentice-Hall, Inc. 7 ?. K2 P+ ?2 h5 `+ L+ O9 }1 @+ R( i% d, s6 X6 B
if nargin==3