Divide a square matix with given rows or column index

1 Ansicht (letzte 30 Tage)
Chugh
Chugh am 14 Nov. 2018
Bearbeitet: madhan ravi am 14 Nov. 2018
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?

Akzeptierte Antwort

Matt J
Matt J am 14 Nov. 2018
Bearbeitet: Matt J am 14 Nov. 2018
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 Kommentare
Matt J
Matt J am 14 Nov. 2018
Bearbeitet: Matt J am 14 Nov. 2018
Can't you just modify my example, changing the partitioning parameters to whatever it is you want?
madhan ravi
madhan ravi am 14 Nov. 2018
Bearbeitet: madhan ravi am 14 Nov. 2018
+1 meets all the requirements OP asked for

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by