another level of dimension check for MatlabJK