
function esempi(caso)

switch caso
    case 1
        x=-1:0.01:1;
        y1=0.5*(1-(sign(x))).*(-x.^2)+2.5*(1+(sign(x))).*x;
        y2=0.5*(1-(sign(x))).*(-x.^2)+2.5*(1+(sign(x))).*(x+1);
        
        clf;
        subplot(2,1,1);
        hold on;
        plot(x,y1,'--rs','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2)
        hold off;
        
        
        subplot(2,1,2);
        hold on;
        plot(x,y2,'--rs','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2)
        hold off;
        
        
    case 2
        x1=-1:0.007:-eps; x2=eps:0.007:-eps; x=[x1 x2];
        
        ya=0.5*(1-(sign(x1))).*(x1-1)+2.5*(1+(sign(x1))).*x1;
        yb=0.5*(1-(sign(x2))).*(x2-1)+2.5*(1+(sign(x2))).*x2;
        y2=0.5*(1-(sign(x))).*(x-1)+2.5*(1+(sign(x))).*(x+1);
        
        clf;
        subplot(2,1,1);
        hold on;
        plot(x1,ya,'k-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2)
        plot(x2,yb,'k-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2)
        hold off;
        
        
        subplot(2,1,2);
        hold on;
        plot(x,y2,'k-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2)
        hold off;
        
        
    case 3
        x1=-1:0.0007:-eps; x2=eps:0.0007:1; x=[x1 x2];
        
        ye=sin(x);
        ys1=-x1.^2-1;
        ys2=x2.^2;
        yt2_1=-log(-x1);
        yt2_2=ones(size(x2));
        
%         ya=0.5*(1-(sign(x1))).*(x1-1)+2.5*(1+(sign(x1))).*x1;
%         yb=0.5*(1-(sign(x2))).*(x2-1)+2.5*(1+(sign(x2))).*x2;
%         y2=0.5*(1-(sign(x))).*(x-1)+2.5*(1+(sign(x))).*(x+1);
        
        clf;
        
        
        subplot(3,1,1);
        hold on; % eliminabile
        plot(x,ye,'k-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2);
        plot(0,-1,'go','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
         plot([0 0],[0 -1],'r--','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);       
        hold off;
        
        
        subplot(3,1,2);
        hold on; % salto
        plot(x1,ys1,'k-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2);
        plot(x2,ys2,'k-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2);
        plot([0 0],[0 -1],'r--','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10); 
                plot(0,-1,'go','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        hold off;
        
        
        subplot(3,1,3);
        hold on; % altro
        plot(x1,yt2_1,'k-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2);
        plot(x2,yt2_2,'k-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2);
%         plot([0 0],[0 -1],'r--','LineWidth',2,...
%             'MarkerEdgeColor','k',...
%             'MarkerFaceColor','g',...
%             'MarkerSize',10); 
        plot(0,1,'go','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        hold off;
        
        case 4
            x=-2:0.01:2;
            y=x.^2-x.^3;
            clf;
            hold on;
            plot(x,y,'r-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2);
             plot(x,zeros(size(x)),'k-','LineWidth',1,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',1);       
        hold off;
        
                
        case 5
            
            x=-2:0.0001:2;
            y=sin(1./x);
            clf;
            subplot(2,1,1)
            hold on;
            plot(x,y,'r-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2);
             plot(x,zeros(size(x)),'k-','LineWidth',1,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',1);       
        hold off;
        
        
                    x=-10^(-3):0.00001:10^(-3);
            y=sin(1./x);
                    subplot(2,1,2)
            hold on;
            plot(x,y,'r-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',2);
             plot(x,zeros(size(x)),'k-','LineWidth',1,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',1);       
        hold off;
        
end