필터 지우기
필터 지우기

how can i append a matrix n times

조회 수: 37 (최근 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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by