function q=mmhole(x,y,z,xlim,ylim) 2 W1 f4 @1 p/ Y: K7 E' L; B%MMHOLE Create Hole in 3D Graphics Data" M1 Y9 ~* s5 l- ?! E, C
% Z=MMHOLE(X,Y,Z,Xlim,Ylim) sets the data in Z to NaN 8 l5 ^/ h' y2 k1 v5 ~% corresponding to the limits in Xlim=[Xmin Xmax] and* k0 u; p+ y# s3 w) j% ^! b6 t
% Ylim=[Ymin Ymax]. If Xlim or Ylim are empty they are 5 U" Q0 v1 x- \, y# v% assumed to be [-inf inf]. 1 c! [" ? h3 x7 x% X and Y can be plaid matrices, e.g., created by MESHGRID / d( @# F' m* r* Y* b- H% or they can be vectors defining the x and y axes. 3 }4 x, M8 n y3 W+ o! v% 7 J, J( g) ^) u* Q% Z=MMHOLE(Z,Clim,Rlim) creates the NaN hole based on the & [" M+ W7 ]6 W, g- d2 O+ Y% column index limits in Clim and the row index limits in Rlim. z2 X8 Z1 C% k- v- E5 X+ I
% 1 f: C; F( S) X: f% Resulting data can be plotted using mesh or surf: 8 |7 E; c s" F$ ` N/ z1 V( f% MESH(X,Y,Z) or SURF(X,Y,Z)6 O4 a! j3 v" Q8 T' D
% This function automates the procedure described on 8 b! t6 U' ]" A: a# @% page 249 of "Mastering MATLAB".; b3 n8 T |. H! [
6 U/ Z8 h# p/ R7 T1 P, j# x
% D.C. Hanselman, University of Maine, Orono ME, 04469 ; f, L2 F+ x- d, z- n3 V+ x+ ` F% 9/26/95 & |5 F, b. K" M: X, ]0 T: v% Copyright (c) 1996 by Prentice-Hall, Inc. ! i0 m/ v0 J" V& {3 N7 v. y4 G$ I1 M/ a% J
if nargin==3