function q=mmhole(x,y,z,xlim,ylim)2 w. m: _5 }3 K- K3 V
%MMHOLE Create Hole in 3D Graphics Data* {0 E3 o' P; M& a. K
% Z=MMHOLE(X,Y,Z,Xlim,Ylim) sets the data in Z to NaN 4 E3 ]- |& J8 c1 p" w$ ?) x4 u3 B- ?1 q% corresponding to the limits in Xlim=[Xmin Xmax] and7 ?7 R% h8 z- q% [' `! x7 u( C
% Ylim=[Ymin Ymax]. If Xlim or Ylim are empty they are" v7 h/ r0 p, p( J( S1 e
% assumed to be [-inf inf]. ; e8 z- V8 y5 t# I8 f% X and Y can be plaid matrices, e.g., created by MESHGRID ! F" M' T6 T% X! X3 l3 j% or they can be vectors defining the x and y axes. / ^8 Q* ^% p6 @%7 x) @3 ?( b0 @6 n. s* Y q
% Z=MMHOLE(Z,Clim,Rlim) creates the NaN hole based on the ) O1 k2 M! u7 E3 r% column index limits in Clim and the row index limits in Rlim; N( z+ ~3 {2 I$ u
% ; K2 C& l' q" \" G- z5 {. j# H4 `' Y) F% Resulting data can be plotted using mesh or surf: 8 t% |: N! f* B$ J% U) \* y( t" d% MESH(X,Y,Z) or SURF(X,Y,Z)/ T- v6 W {) \8 ^5 G% ~# @
% This function automates the procedure described on, X" T/ E U4 A% y
% page 249 of "Mastering MATLAB". 8 Y7 R& t; @1 l+ W7 a. O, `! r9 \3 j) c4 T, Q- J( d
% D.C. Hanselman, University of Maine, Orono ME, 044697 R7 e+ s$ ~/ e2 I. {
% 9/26/95 ; K ^ B' h/ s! {6 F. @% Copyright (c) 1996 by Prentice-Hall, Inc. 0 F( k, @: T' z; k! U5 {9 a& s+ C5 u1 W% F$ g D
if nargin==3