Simple array addition question
조회 수: 3 (최근 30일)
이전 댓글 표시
if I have a matrix [1,2] and I want to add a 3rd element [3] to make [1,2,3]
And what is this simple manipulation called? 2 hours of searching has got me nowhere.
Kind regards
RK
댓글 수: 2
Jan
2012년 11월 20일
편집: Jan
2012년 11월 20일
@Robert: The operation is called "concatenation". Such questions are exhaustively explained in the "Getting Started" chapter of the documentation. While it is strongly recommended to read them, because Matlab is a very powerful language, the forum is not the right place to learn the very basics. Thanks.
채택된 답변
per isakson
2012년 11월 20일
Hint:
x = [ 1, 2 ];
x(end+1) = 3;
or
x = cat( 2, x, 3 );
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!