It is common practice in MATLAB to use the colon operator :
for converting anything into a column vector. Without knowing or caring if normal
is a row vector or a column vector, you can force p
to be a column vector, like so:
p = p(:);
After this, p
is guaranteed to be a column vector.