How to create a specific Matrix

2 次查看(过去 30 天)
Sara Trova
Sara Trova 2020-3-5
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
c = [1 1 2 2 3 3]' ;
iwant = repmat(l',1,4) ;

Bhaskar R
Bhaskar R 2020-3-5
M = repelem([1:3]', 2, 4)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by