How to create a specific Matrix

Hi !
Can anyone help me in builting this specific matrix? I do not know if the "randi" function is the exact one.
Thank you in advance for your help!

回答 (2 件)

KSSV
KSSV 2020 年 3 月 5 日

0 投票

c = [1 1 2 2 3 3]' ;
iwant = repmat(l',1,4) ;
Bhaskar R
Bhaskar R 2020 年 3 月 5 日

0 投票

M = repelem([1:3]', 2, 4)

1 件のコメント

Sara Trova
Sara Trova 2020 年 3 月 5 日
Thank you very much!!

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

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2020 年 3 月 5 日

コメント済み:

2020 年 3 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by