>> x=-1:0.01:1;>> y=-1:0.02:1;>> [xx,yy]=meshgrid(x,y);>> zz=xx.^2+yy.^2;>> contour(xx,yy,zz,20)>> figure%left,right,top,bottom为去掉的部分>> left=-0.4;>> right=0.6;>> top=-0.1;>> bottom=-0.5;>> zz(find((xx>left).*(xxbottom).*(yy>> contour(xx,yy,zz,20)
把对应不要的区域换成nan