replace ismatrix, because matlab doesn't support it for >=3D matrices
change error message because of some matlab incompatibilities...dunno why