function q=mmhole(x,y,z,xlim,ylim) * f! X; y4 }/ y8 }% A- }2 v%MMHOLE Create Hole in 3D Graphics Data 4 K0 T; Y, ]3 o% Z=MMHOLE(X,Y,Z,Xlim,Ylim) sets the data in Z to NaN/ h2 ^* b& S1 R! P, j# f
% corresponding to the limits in Xlim=[Xmin Xmax] and * G; v! r! \" J7 ]1 l% Ylim=[Ymin Ymax]. If Xlim or Ylim are empty they are: D2 [3 n# `+ I5 A( T
% assumed to be [-inf inf]. " k6 M- i2 T+ R! F% X and Y can be plaid matrices, e.g., created by MESHGRID+ ~+ v( _8 u% Y$ e8 S
% or they can be vectors defining the x and y axes. * X- v/ o! W" N$ f' d5 Z% ) \3 B) {- m- U; A6 Y4 w' G% Z=MMHOLE(Z,Clim,Rlim) creates the NaN hole based on the 5 B0 k m5 I: ^& O2 t' S# }3 H% column index limits in Clim and the row index limits in Rlim " R( q6 p& ~$ y- j' U* q8 t% ; x. c' t" q/ r& r/ c' M% Resulting data can be plotted using mesh or surf: 8 @; Q% J7 Q* O: v% MESH(X,Y,Z) or SURF(X,Y,Z) + e. F+ Q% f* w* ^* c. l% This function automates the procedure described on+ {: z- }: e3 @& r2 w
% page 249 of "Mastering MATLAB". 6 o0 b: y( F; k' v' N2 ^$ K& j# V& L# @+ q) v
% D.C. Hanselman, University of Maine, Orono ME, 04469* z/ L! ^& [( { `8 U9 S' c( g `% {
% 9/26/954 I: h" {- X+ \ |) [& c+ F
% Copyright (c) 1996 by Prentice-Hall, Inc. ( ~8 H6 H. ?3 a( ? ! Q9 G4 X @+ l! Q. Qif nargin==3