Message Boards Message Boards

0
|
2486 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

MatrixCase as a new function ??

Posted 4 years ago

Mathematica has excellent ways to manipulate Sequences. But it has no such methods for dealing with arrays

a = RandomInteger[10, {4, 4}];

ReplaceList[a, {___, {e___, x_, y_, ___}, {e1___, x1_, 
     y1_, ___}, ___} /; Length[{e}] == Length[{e1}] -> 
  MatrixForm[{{x, y}, {x1, y1}}]]

Can we simply have a function like this

MatrixCases[Matrix, {{_, _}, {_, _}}]

General rule. that give us the same result or extract all patterns from the array.

POSTED BY: ismail ali
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract