Skip to main content
added 34 characters in body
Source Link
E. Chan-López
  • 33.7k
  • 3
  • 34
  • 54

Using the eldo's data:

m = Partition[Range @ 100, 10]; 

An alternative is to use TakeDrop:

dropRC[m_dropRowsCols[m_, rows : {_, _}, cols : {_, _}] := TakeDrop[ Part[  TakeDrop[  Transpose[  Part[  TakeDrop[  Transpose@TakeDrop[Transpose@m,  Transpose @ m, rows  ], 2  ]], cols  ],  rows][[2]],2  cols][[2]]; ]; dropRC[mdropRowsCols[m, {2, 6}, {2, 3}] // MatrixForm 

enter image description here

Using the eldo's data:

m = Partition[Range @ 100, 10]; 

An alternative is to use TakeDrop:

dropRC[m_, rows : {_, _}, cols : {_, _}] := TakeDrop[ Transpose@TakeDrop[Transpose@m,  rows][[2]], cols][[2]]; dropRC[m, {2, 6}, {2, 3}] // MatrixForm 

enter image description here

Using the eldo's data:

m = Partition[Range @ 100, 10]; 

An alternative is to use TakeDrop:

dropRowsCols[m_, rows : {_, _}, cols : {_, _}] := Part[  TakeDrop[  Transpose[  Part[  TakeDrop[  Transpose @ m, rows  ], 2  ]], cols  ],  2   ]; dropRowsCols[m, {2, 6}, {2, 3}] // MatrixForm 

enter image description here

Source Link
E. Chan-López
  • 33.7k
  • 3
  • 34
  • 54

Using the eldo's data:

m = Partition[Range @ 100, 10]; 

An alternative is to use TakeDrop:

dropRC[m_, rows : {_, _}, cols : {_, _}] := TakeDrop[ Transpose@TakeDrop[Transpose@m, rows][[2]], cols][[2]]; dropRC[m, {2, 6}, {2, 3}] // MatrixForm 

enter image description here