function q=mmhole(x,y,z,xlim,ylim)9 a2 y" M1 k$ c% e
%MMHOLE Create Hole in 3D Graphics Data. m! b" p5 B8 O1 }
% Z=MMHOLE(X,Y,Z,Xlim,Ylim) sets the data in Z to NaN7 I, B% t D+ a1 @4 W8 E, D- ]9 b* u
% corresponding to the limits in Xlim=[Xmin Xmax] and % {. v0 Y6 g! D9 _% Ylim=[Ymin Ymax]. If Xlim or Ylim are empty they are8 f2 I% o0 \" A4 g! z3 d V2 V! |
% assumed to be [-inf inf].8 W9 b# d+ B, E* c9 K
% X and Y can be plaid matrices, e.g., created by MESHGRID K; M6 ^+ c4 N% or they can be vectors defining the x and y axes. % d+ |7 \( r* K! V* J; I%7 S' G8 k" f$ y5 @9 B
% Z=MMHOLE(Z,Clim,Rlim) creates the NaN hole based on the 9 S1 v# N8 ?( c' W4 c
% column index limits in Clim and the row index limits in Rlim / ~. f! }( F! B0 @8 D%8 n s" G- ?$ \7 V0 i8 T+ ^$ X
% Resulting data can be plotted using mesh or surf: 3 M# `2 {# Y7 y' V; f+ g% MESH(X,Y,Z) or SURF(X,Y,Z) + k) O8 { U6 x0 |) t% This function automates the procedure described on 0 ^& {$ K$ _' v- K* I, p5 Q2 \* [% page 249 of "Mastering MATLAB". 5 ]0 y5 }. j! J! X" f, X/ p2 x; z `
% D.C. Hanselman, University of Maine, Orono ME, 04469- V( l* u. f% n0 v# D
% 9/26/95) t4 y/ b* Q2 f* Q# t2 l# B4 u) ^
% Copyright (c) 1996 by Prentice-Hall, Inc. 5 H3 ~: L' |' e L' R' G# k& x0 b+ ^; V$ Z U9 C4 K9 u
if nargin==3