How Can I union four non-equal size vector in matlab?
조회 수: 2 (최근 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!