function q=mmhole(x,y,z,xlim,ylim)! A B' i# E& V c& a! r
%MMHOLE Create Hole in 3D Graphics Data % V6 _0 P& a6 K- Y L3 ]% Z=MMHOLE(X,Y,Z,Xlim,Ylim) sets the data in Z to NaN9 |3 w2 w. r6 K' n% `* m
% corresponding to the limits in Xlim=[Xmin Xmax] and , y7 ^* j8 T) I1 `; Q% Ylim=[Ymin Ymax]. If Xlim or Ylim are empty they are - L; q1 G/ d- M2 M. _7 ?, |0 ~% assumed to be [-inf inf]. % K6 G: N4 z1 k: p# Z: M% X and Y can be plaid matrices, e.g., created by MESHGRID; o- ^2 |8 W. k+ y
% or they can be vectors defining the x and y axes.3 ]7 S5 V3 M2 k- X% p
%3 k1 G( z# [5 r5 }
% Z=MMHOLE(Z,Clim,Rlim) creates the NaN hole based on the / k+ q* e0 E3 Y
% column index limits in Clim and the row index limits in Rlim: M/ Z" k" u8 G" @. ?- b* e6 Q: m, o
% 8 p" G/ o3 l- o/ X. c2 t% Resulting data can be plotted using mesh or surf:" O' \% Z9 x% t
% MESH(X,Y,Z) or SURF(X,Y,Z)4 y4 J( d* Z' Q' @ i! Q
% This function automates the procedure described on ! w8 E# _1 \8 u# y% page 249 of "Mastering MATLAB". % @; P$ @& ]9 x7 s. \! I / Y/ M% D7 K/ [# w o; X% D.C. Hanselman, University of Maine, Orono ME, 04469 0 t7 L/ o& P C# n) K8 g% 9/26/95 ) g8 b4 \: ]( R6 d2 \% Copyright (c) 1996 by Prentice-Hall, Inc.% N. ?, J" i2 g) ]0 Q3 ~. H
8 B* c2 f0 ]6 d) \+ F
if nargin==3