Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

14
  • $\begingroup$ Yes, it works fine. Can we extend your Code to do operations on more than 2 columns and more than 2 rows. My example was for illustrative purposes, and in reality I have a matrix of 60 by 60, and need to reduce its dimension to 25 by 25. Thank you for your answer. $\endgroup$ Commented Mar 5, 2019 at 1:27
  • 1
    $\begingroup$ @TugrulTemel, I updated f to work with arbitrary number of rows and columns. $\endgroup$ Commented Mar 5, 2019 at 1:54
  • 1
    $\begingroup$ @Tugrul, updated f to take lists of lists of rows (and columns) to be combined. $\endgroup$ Commented Mar 6, 2019 at 7:24
  • 1
    $\begingroup$ Tugrul, if the row (or column) to be moved is not necessarily one of the rows (columns) that appear in the arguments of f, then it is probably a good idea to post as a new question. If it is, than you can re-shuffle the list of rows (say, {2,3,4}) to be combined so that the target position (say, 4) appears first (that is, use {4,2,3}). Similarly for the list of of columns to be combined. $\endgroup$ Commented Mar 12, 2019 at 22:45
  • 1
    $\begingroup$ @Tugrul, for the second case this may be useful. $\endgroup$ Commented Mar 12, 2019 at 23:41