vec2mat is not recommended. Usereshapeinstead. Given a vector input,reshapecreates its corresponding matrix one column at a time (instead of one row at a time). reshaperequires its input and output arrays to have the same number of elements, whereasvec2matpads its output matrix if necessary. ...