フィルターのクリア

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 Center および File ExchangeWorkspace 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