How can shape a matrix with predefined vectors?

4 ビュー (過去 30 日間)
Ayob
Ayob 2013 年 5 月 1 日
I want to make a 3*12 matrix which its first, second and third row is N1, N2 and N3.
N1, N2 and N3 are 1*12 vectors.
I can use [N1(1) N1(2) ....N1(12); N2(1) N2(2) ....N2(12); N3(1) N3(2) ... N3(12)]
but it's ugly and slow, I want to use Matlab special features in matrix handling.

採用された回答

Matt Kindig
Matt Kindig 2013 年 5 月 1 日
編集済み: Matt Kindig 2013 年 5 月 1 日
N = [N1; N2; N3];

その他の回答 (1 件)

Antoine
Antoine 2013 年 5 月 1 日
You have a general function of concatenation that you could look at. Learn to handle it, it is very useful !
>> help cat
It should solve your problem with
>> cat(1,N1,N2,N3)
Note : it is equivalent to
>> [N1;N2;N3]

カテゴリ

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