function q=mmhole(x,y,z,xlim,ylim) % y- T; H. |) j9 S# F%MMHOLE Create Hole in 3D Graphics Data $ r& u {) d4 u. F% Z=MMHOLE(X,Y,Z,Xlim,Ylim) sets the data in Z to NaN ( s' @/ S/ e. N! s% corresponding to the limits in Xlim=[Xmin Xmax] and $ a+ Y1 R+ h% m8 n3 h% Ylim=[Ymin Ymax]. If Xlim or Ylim are empty they are- N9 |2 ]0 M: Q3 I6 Z; F
% assumed to be [-inf inf].! U7 h2 r! _3 z$ a
% X and Y can be plaid matrices, e.g., created by MESHGRID3 B- A3 {* O3 `% H( C
% or they can be vectors defining the x and y axes.4 b6 I6 L$ @' ^# i) W9 L8 h
% 6 f) n. G( j6 |. v* X; C) l& I% Z=MMHOLE(Z,Clim,Rlim) creates the NaN hole based on the 5 F0 ~- l- P% i- s
% column index limits in Clim and the row index limits in Rlim + Y3 B, V7 X3 a$ k Z% / Z, G0 C: C; ]- X5 N" q$ a% Resulting data can be plotted using mesh or surf:% ^# Y) K! l$ B, p) f! S
% MESH(X,Y,Z) or SURF(X,Y,Z) . ~' n& W0 ]% w1 b* T; O% This function automates the procedure described on/ j5 G+ H: o. ^: d8 D2 f
% page 249 of "Mastering MATLAB". * h' F" h( z0 q2 ^3 y. d ' k: k( j: ^ u/ u/ F, ]% D.C. Hanselman, University of Maine, Orono ME, 04469 3 U: }8 m. a7 x6 S2 \$ R$ o% 9/26/95- a; q! I% @. c
% Copyright (c) 1996 by Prentice-Hall, Inc. ( \$ O r7 R3 ^ 1 C5 }! C/ G9 ^7 ?3 F5 oif nargin==3