The problem is:
Product of known dimensions, 3, not divisible into total number of elements, 16.
this because i want to reshape a
reshape
You should add zeros in the beginnig. What I mean:
vec = [1:16]' nRow = 3; nCol = 6; zeroFill = nRow * nCol - length(vec); newVec = [vec; zeros(zeroFill, 1)]; mat = reshape(newVec, [nRow nCol])