How to create a specific Matrix

조회 수: 2 (최근 30일)
Sara Trova
Sara Trova 2020년 3월 5일
댓글: 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에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by