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

2 ビュー (過去 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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by