MATLAB: I have two column vectors of size 100×1, how to make a single vector of size 100×2 having two columns as the two column vectors

vectors

I have two column vectors of size 100×1, how to make a single vector of size 100×2 having two columns as the two column vectors ?

Best Answer

vec1 = rand(10,1) ;
vec2 = rand(10,1) ;
iwant = [vec1 vec2] ;
Please note after joining two vectors, it will be a matrix not a vector.