fixing vector and matrices dimensions