Define K for empty matrix