필터 지우기
필터 지우기

reiterating 1s and 0s in a single column

조회 수: 3 (최근 30일)
Michael Angeles
Michael Angeles 2022년 1월 29일
답변: Voss 2022년 1월 29일
Hello how do I make my data repeat x amount of times in the same column by copying the original sequence of data?
example data:
Column A has binary data [0;1;1;1;1;0;1;1]
Thank you!

채택된 답변

Voss
Voss 2022년 1월 29일
Use repmat():
A = [0;1;1;1;1;0;1;1];
x = 4;
B = repmat(A,x,1);
disp(B);
0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 1

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by