%PRESTABLE

function PS=prestable(C,k)
if k==1
  s=0;
  for i1=1:6-k
    s=s+det(C([i1],[i1]));
  end
  PS=s;
  if PS<=0 
    k
    error('UC is not prestable for n=5')
  end
elseif k==2
  s=0;
  for i1=1:4
    for i2=i1+1:5
      s=s+det(C([i1 i2],[i1 i2]));
    end
  end
  PS=s;
  if PS<=0 
    k
    error('U is not prestable for n=5') 
  end
elseif k==3
  s=0;
  for i1=1:3
    for i2=i1+1:5
      for i3=i2+1:5
        s=s+det(C([i1 i2 i3],[i1 i2 i3]));
      end
    end
  end
  PS=s;
  if PS<=0 
    k
    error('U is not prestable for n=5')
  end
elseif k==4
  s=0;
  for i1=1:2
    for i2=i1+1:5
      for i3=i2+1:5
        for i4=i3+1:5
          s=s+det(C([i1 i2 i3 i4],[i1 i2 i3 i4]));
        end
      end
    end
  end
  PS=s;
  if PS<=0
    error('U is not prestable for n=5')
  end
else
  PS=det(C); 
  if PS<=0 
    error('U is not prestable for n=5')
  end
end
