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 CenterFile Exchange에서 Networks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by