function q=mmhole(x,y,z,xlim,ylim) ' l, ]# } B" y/ ^%MMHOLE Create Hole in 3D Graphics Data # Z2 L" l5 r" x- L( b1 i% Z=MMHOLE(X,Y,Z,Xlim,Ylim) sets the data in Z to NaN6 T C1 h# V$ v
% corresponding to the limits in Xlim=[Xmin Xmax] and 3 _ {3 }! _9 H$ v( {8 g- | {% Ylim=[Ymin Ymax]. If Xlim or Ylim are empty they are) G' O+ R$ [! {% n, U
% assumed to be [-inf inf]. : b1 E+ x% g, B6 z% X and Y can be plaid matrices, e.g., created by MESHGRID o7 k2 c; a' Y: O; q- p* H+ a- x2 R% or they can be vectors defining the x and y axes./ M* @9 {( ~, _
%( G$ l1 _$ K. j% `! E# U2 \
% Z=MMHOLE(Z,Clim,Rlim) creates the NaN hole based on the . K# B, k: A8 ?% column index limits in Clim and the row index limits in Rlim, p) @6 u8 A6 h* J( K3 Z9 o ~
%, i" K0 T2 E2 }$ q) _" @9 w
% Resulting data can be plotted using mesh or surf: " q& m$ \# D% ^/ c% MESH(X,Y,Z) or SURF(X,Y,Z) ( C5 F7 Q/ u- B4 m7 l# X. a0 ~; g% This function automates the procedure described on2 n% K# C+ r0 W3 u* D
% page 249 of "Mastering MATLAB". 7 k6 z8 O( x& Q7 P; i+ Y/ }# B! j0 P1 I6 V) U! r' c' e8 i
% D.C. Hanselman, University of Maine, Orono ME, 044695 y, N, R8 L- e( L( a) V
% 9/26/95. A7 W" l1 g! `' O+ D; e1 B
% Copyright (c) 1996 by Prentice-Hall, Inc.& g* i, v7 m7 M& H9 L0 W
4 Q9 w y9 |# f! s$ H* E
if nargin==3