X=-3:0.1:3.5; 
Y=-2:0.1:2;
[x,y]=meshgrid(X,Y);

z=sin(x+y.^2);

subplot(1,2,1)
surf(x,y,z)

%1os tropos
subplot(1,2,2)
surf(x,y,z.*(x+y.^2>0&x+y.^2<pi))

%2os tropos
term=x+y.^2;
s=size(term)
s1=s(1);
s2=s(2);

for j=1:s1
    for k=1:s2
        if term(j,k)<0||term(j,k)>pi
            z(j,k)=0;
        end
    end
end
subplot(1,2,2)
surf(x,y,z)
