matrix directive validation