필터 지우기
필터 지우기

Divide a square matix with given rows or column index

조회 수: 1 (최근 30일)
Chugh
Chugh 2018년 11월 14일
편집: madhan ravi 2018년 11월 14일
Hi,
I have a square matix of size 10 x 10. I want to partition it by using given index of two rows and columns e.g. 2, 7. In that way, I will have seveal blocks of matrices. How do I get it?

채택된 답변

Matt J
Matt J 2018년 11월 14일
편집: Matt J 2018년 11월 14일
Let's say your matrix is A.
>> blocks = mat2cell(A,[2,8],[2,8])
blocks =
2×2 cell array
{2×2 double} {2×8 double}
{8×2 double} {8×8 double}
  댓글 수: 2
Matt J
Matt J 2018년 11월 14일
편집: Matt J 2018년 11월 14일
Can't you just modify my example, changing the partitioning parameters to whatever it is you want?
madhan ravi
madhan ravi 2018년 11월 14일
편집: madhan ravi 2018년 11월 14일
+1 meets all the requirements OP asked for

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

추가 답변 (0개)

카테고리

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