support mxn matrix