Replicating rows/columns within a matrix, kron function

3 ビュー (過去 30 日間)
Perry
Perry 2012 年 1 月 27 日
コメント済み: Sean de Wolski 2017 年 10 月 4 日
I would like to replicate every row within a matrix a multiple of times. I tried using the kron function but I can't seem to get it to replicate the rows more than twice. As an example, I would like to go from: [3 4; 5 6] to [3 4; 3 4; 3 4; 5 6; 5 6; 5 6]
Any help would be greatly appreciated.
Thanks!

採用された回答

Sean de Wolski
Sean de Wolski 2012 年 1 月 27 日
kron([3 4; 5 6],ones(3,1))
  3 件のコメント
Raksha Gopal Kulkarni
Raksha Gopal Kulkarni 2017 年 9 月 28 日
Thank you!!! exactly what I was looking for!!!!
Sean de Wolski
Sean de Wolski 2017 年 10 月 4 日
Note that this answer is old. You should now use repelem in more modern releases.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNetworks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by