VEC2COL Ensures that a variable not has less rows than columnss. The most common application of this function is to ensure that a vector is a column vector. FORMAT v = vec2col(v) OUT v A variable of any type. IN v The variable possible transposed.
0001 % VEC2COL Ensures that a variable not has less rows than columnss. 0002 % 0003 % The most common application of this function is to ensure that a 0004 % vector is a column vector. 0005 % 0006 % FORMAT v = vec2col(v) 0007 % 0008 % OUT v A variable of any type. 0009 % IN v The variable possible transposed. 0010 0011 % 1993 Created by Patrick Eriksson. 0012 % 2002-12-10 Adapted to Atmlab from arts/ami. 0013 % 2013-03-04 Bugfix by Gerrit Holl for empty vector + do not get conj 0014 0015 function v = vec2col(v) 0016 0017 wid = ['atmlab:' mfilename ':zero']; 0018 [rows,cols] = size(v); 0019 0020 if all(size(v)==0) 0021 warning(wid, 'Cannot convert zero-sized vector to column'); 0022 end 0023 0024 if (isempty(v) && ~iscolumn(v)) || (~isempty(v) && cols > rows) 0025 v = v.'; 0026 end 0027 end