필터 지우기
필터 지우기

What does the symbol ";" mean in the statement "p1 = [x; y]"?

조회 수: 4 (최근 30일)
Manoj Murali
Manoj Murali 2012년 2월 15일
편집: dpb 2013년 10월 13일
What does the symbol ";" mean in the following statement?
p1 = [x; y];

채택된 답변

Friedrich
Friedrich 2012년 2월 15일
Hi,
this means x and y are combined vertically to a new vector. So p1 = [x;y] creates a vector
p1 = (x)
(y)
Or simply try it with an example
p1 = [1;2]
  댓글 수: 3
Andrei Bobrov
Andrei Bobrov 2012년 2월 15일
yes
Jan
Jan 2012년 2월 15일
Horizontal concatenation: [a, b], or [a b] or cat(2, a, b) or horzcat(a, b)
Vertical concatenation: [a; b], cat(1, a, b), vertcat(a, b)
Another method, which is prone to errors is using the line break as separator:
[a
b]

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

k.v.swamy
k.v.swamy 2012년 2월 15일
hi, p1 = [x; y]; means u r combining the vectors x and y in to a single vector p1.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by