how to crreate an array

3 ビュー (過去 30 日間)
Awesomer
Awesomer 2017 年 11 月 5 日
コメント済み: Awesomer 2017 年 11 月 5 日
lets say i have an array x=[1 0 1] how can i sample every bit 10 times. output will be 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1

採用された回答

Star Strider
Star Strider 2017 年 11 月 5 日
編集済み: Star Strider 2017 年 11 月 5 日
Try this:
x=[1 0 1];
N = 10;
Output = reshape(repmat(x(:)', N, 1), 1, [])
  2 件のコメント
Awesomer
Awesomer 2017 年 11 月 5 日
It works! Thank you so much.
Star Strider
Star Strider 2017 年 11 月 5 日
As always, my pleasure!

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

その他の回答 (1 件)

Steven Lord
Steven Lord 2017 年 11 月 5 日
Use the repelem function.
  1 件のコメント
Awesomer
Awesomer 2017 年 11 月 5 日
Thank you so much for answer.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by