how can i append a matrix n times

25 ビュー (過去 30 日間)
Mallikarjuna
Mallikarjuna 2012 年 11 月 21 日
i have a matrix "A" which has to be concatenated 600 times to make a new matrix. please help me doing it
for example, i have a matrix B = [1 2], i want to create a matrix "C" which is matrix B concatenated 5 times
C = [B B B B B];
which would evaluate to [1 2 1 2 1 2 1 2 1 2]
what should i do to make it 600 times!!!!
  2 件のコメント
Daniel Shub
Daniel Shub 2012 年 11 月 21 日
Have you looked at repmat?
Mallikarjuna
Mallikarjuna 2012 年 11 月 21 日
thank you Daniel

サインインしてコメントする。

採用された回答

Akiva Gordon
Akiva Gordon 2012 年 11 月 21 日
You are looking for the repmat function.
B = [1 2];
C = repmat(B,1,600)
This will repeat matrix B for 1 row and 600 columns.

その他の回答 (0 件)

カテゴリ

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