function q=mmhole(x,y,z,xlim,ylim) / q3 D8 e/ |- L* A%MMHOLE Create Hole in 3D Graphics Data ) m: W% y% Q( w5 R8 a2 ~% Z=MMHOLE(X,Y,Z,Xlim,Ylim) sets the data in Z to NaN5 z5 E/ C w' N( D4 l$ f- ?
% corresponding to the limits in Xlim=[Xmin Xmax] and , m$ c6 o3 M. s% Ylim=[Ymin Ymax]. If Xlim or Ylim are empty they are " T, m! K- i- ]$ d. ^: _6 S% assumed to be [-inf inf].2 K. {/ D! i* Z) m9 }
% X and Y can be plaid matrices, e.g., created by MESHGRID # B; h; E5 E6 l9 ?% or they can be vectors defining the x and y axes. , z$ z) n! s1 G+ V$ t7 c) M% ) t; N0 L4 U6 Q( D4 m, S9 Z1 Q% Z=MMHOLE(Z,Clim,Rlim) creates the NaN hole based on the ! P" r9 d% G6 F5 R* B; \3 X1 Z2 M% column index limits in Clim and the row index limits in Rlim' D$ H# Q' U! I3 h6 y
%3 d! g4 o7 l) I& ~$ r
% Resulting data can be plotted using mesh or surf:( Q& C/ [8 v+ t
% MESH(X,Y,Z) or SURF(X,Y,Z) 8 Y2 U& @) z# ?0 t. p$ p0 s" ^% Q% This function automates the procedure described on* Z6 d( d* W/ R1 a7 B
% page 249 of "Mastering MATLAB".' _# C5 C1 ^0 Y4 l9 p' E j+ k
- A( [' q* D+ d0 I% j" V: W) X
% D.C. Hanselman, University of Maine, Orono ME, 04469 ' O5 d0 l1 I0 S6 {0 x8 A) ~% 9/26/95. N3 P! u$ g% b# _* S" H% H$ f
% Copyright (c) 1996 by Prentice-Hall, Inc. " I5 z* }( m4 O& u) ?; l 2 o# P! `; X# p" P6 h- ^% p+ {if nargin==3