How do I partition a n by m matrix into equal rows

조회 수: 6 (최근 30일)
Princewill Azorom
Princewill Azorom 2020년 8월 3일
댓글: Walter Roberson 2020년 8월 5일
How do I partition an n by m matrix into equal rows please I've been trying to write a script that does this but I haven't been having much progress please can anyone help me
  댓글 수: 2
Matt J
Matt J 2020년 8월 4일
Princewill Azorom's question moved here:
Okay... here goes. Write a function that takes two positive integer inputs n and m. The function returns a 3n by m matrix called T. The top third of T(an n by m submatrix) is all 1's, the middle third is all 2's while the bottom third is all 3's.
Walter Roberson
Walter Roberson 2020년 8월 5일
Hint:
A = array of ones
B = array of twos
C = array of threes
[A;B;C]

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2020년 8월 4일

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by