필터 지우기
필터 지우기

how do i print this matrix?

조회 수: 1 (최근 30일)
Ann Lee
Ann Lee 2022년 4월 1일
답변: Stephen23 2022년 4월 1일
hi!
i want to print this matrix..
i think there is a easy pattern in this matrix but i couldn't found..!
Is there a easy way to create this matrix?

채택된 답변

KSSV
KSSV 2022년 4월 1일
A = zeros(6,5) ;
A(1:3,1:3) = 1 ;
A(:,4) = [1 0 0 1 1 1]' ;
A(:,5) = [1 0 0 1 1 1]' ;
A
A = 6×5
1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1
  댓글 수: 1
Ann Lee
Ann Lee 2022년 4월 1일
thank you again!!!!!! have a good day!!

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

추가 답변 (1개)

Stephen23
Stephen23 2022년 4월 1일
M = repelem([1,1;1,0;0,1],[1,2,3],[3,2])
M = 6×5
1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by