function phi=structure(z)

N=size(z,1); phi=zeros(N,1); n=(1+sqrt(1+8*size(z,2)))/2;

for i=1:N
    P=feval('vect2mat',z(i,:)); P1=zeros(n);
    for k=1:n-1
        P1=P^k+P1;
        if P1(1,n)>=1
            phi(i)=1;
            break;
        else
            if k==n-1
                phi(i)=0;
            end
        end
    end
end
