How Can I union four non-equal size vector in matlab?
1 次查看(过去 30 天)
显示 更早的评论
Hi I want to write Finite element MATLAB code. I want to union 4 vectors that they are different in their sizes. I used "unique" command, however; My program has this Error:
"Error using horzcat Dimensions of matrices being concatenated are not consistent."
0 个评论
采纳的回答
更多回答(1 个)
Mohammad Monfared
2013-11-17
To union two vectors they should be of the same kind, row vectors or column vectors.
if they are row vectors;
v=[v1, v2];
if they are column vectors:
v=[v1; v2];
3 个评论
Mohammad Monfared
2013-11-17
编辑:Mohammad Monfared
2013-11-17
In this case size does not matter and you can switch between column and row vector as:
v=v' ;
two additional functions are also available which are isrow() and iscolumn(). They are useful when you don't know if a vector is in row or column shape.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!