function q=mmhole(x,y,z,xlim,ylim) 8 r( W6 v0 h/ b, H( G! G%MMHOLE Create Hole in 3D Graphics Data / i6 [2 K" i! E: y( x* m9 v% Z=MMHOLE(X,Y,Z,Xlim,Ylim) sets the data in Z to NaN ( X4 Z# A& c( |+ O6 K4 w" ^% corresponding to the limits in Xlim=[Xmin Xmax] and - u; i2 f4 V. G& p% Ylim=[Ymin Ymax]. If Xlim or Ylim are empty they are 7 y8 U' O3 ?8 a( `( t" e% assumed to be [-inf inf].6 `* I; [0 _' y7 O3 }$ `
% X and Y can be plaid matrices, e.g., created by MESHGRID+ s' @) @6 l. s ] c
% or they can be vectors defining the x and y axes. * T, M2 k4 }$ a. r3 p4 g%/ Q2 h$ _ r, f: U7 d8 x
% Z=MMHOLE(Z,Clim,Rlim) creates the NaN hole based on the : \/ r! ^) ~; C- B) v% column index limits in Clim and the row index limits in Rlim . S- v+ }5 q6 G6 w%$ ?# X9 ?8 X% Z# ^
% Resulting data can be plotted using mesh or surf:$ D, d/ t- O. { s# F% z
% MESH(X,Y,Z) or SURF(X,Y,Z) , f4 H# j7 D! L: p# N* t7 Q% This function automates the procedure described on 6 A# l( y( M' Q+ a* [9 G5 k% page 249 of "Mastering MATLAB".5 K7 j8 W& g8 t# t* V, S4 s
3 D' K& V9 g" [# G% D.C. Hanselman, University of Maine, Orono ME, 04469 ; [: P+ N. @+ b% 9/26/95 1 w# U' M6 K! e- U v% Copyright (c) 1996 by Prentice-Hall, Inc. # ~: z' D9 w& c- r) S3 _4 z0 {0 M , \1 E1 Z$ `8 \+ K" cif nargin==3