function minsurf2
    xmin= -1; xmax= 1;
    ymin= -1; ymax= 1;
    n= 60; m= 60;
    hx=(xmax-xmin)/n; hy= (ymax-ymin)/m;
    xvalues= xmin:hx:xmax;
    yvalues= ymin:hy:ymax;
    [x,y]= meshgrid(xvalues,yvalues);
    zval= D(x,y);
    d= zval<0;
    numpoints= sum(sum(double(d)));

    p= zeros(1,numpoints); % initial values

    p= fminunc(@fdint,p);

    plots(p)
    function s=fdint(p)
        [x,y,z]= points_to_matrix(p);
        s= 0;
        for i=1:n
            for j=1:m
                dzdx= (z(i+1,j)-z(i,j))/hx;
                dzdy= (z(i,j+1)-z(i,j))/hy;
                s=s+hx*hy*sqrt(1+dzdx^2+dzdy^2);
            end
        end
    end
    function [x,y,z]= points_to_matrix(p)
        [x,y]= meshgrid(xvalues,yvalues);
        z= zbnd(x,y);
        z(d)= p;
    end
    function plots(p)
        [x,y,z]= points_to_matrix(p);
        h= surf(x,y,z);
        set(h,'AlphaData',double(d));
        set(h,'FaceColor','texturemap');
        set(h,'FaceAlpha','texturemap');
        hold on
        phi= 0:pi/20:2*pi;
        k=plot3(3/4*cos(phi),3/4*sin(phi),(3/4*sin(phi)).^2,'r');
        set(k,'LineWidth',3);
      end
end

function d= D(x,y)
    d= x.^2+y.^2-9/16;
end
function z= zbnd(x,y)
    z= y.^2;
end
