How eliminate in an arbitrary order in subgroup of a nested matrix
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
How can reach the second matrix from the first nested one:
first=0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1,
0;
second=0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0;
list-manipulation matrix
add a comment |Â
up vote
3
down vote
favorite
How can reach the second matrix from the first nested one:
first=0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1,
0;
second=0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0;
list-manipulation matrix
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
How can reach the second matrix from the first nested one:
first=0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1,
0;
second=0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0;
list-manipulation matrix
How can reach the second matrix from the first nested one:
first=0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1,
0;
second=0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0;
list-manipulation matrix
asked Aug 8 at 4:29


Irreversible
1,623621
1,623621
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
5
down vote
accepted
One way to do this is with ArrayFlatten:
ArrayFlatten[first]
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
add a comment |Â
up vote
4
down vote
ArrayReshape[first, 4, 4]
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
Also
Module[x = #, x[[All, 0]] = Sequence; x[[All, All, All, 0]] = Sequence; x] &@first
MapAt[Sequence &, first, All, 0, All, All, All, 0]
ReplacePart[first, _, 0 -> Sequence, _, _, _, 0 :> Sequence]
add a comment |Â
up vote
3
down vote
Two approaches I can think of:
Partition[Flatten[first], 4]
Flatten[first, 1, 2, 3, 4]
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
One way to do this is with ArrayFlatten:
ArrayFlatten[first]
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
add a comment |Â
up vote
5
down vote
accepted
One way to do this is with ArrayFlatten:
ArrayFlatten[first]
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
One way to do this is with ArrayFlatten:
ArrayFlatten[first]
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
One way to do this is with ArrayFlatten:
ArrayFlatten[first]
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
answered Aug 8 at 5:01


bill s
50.5k373142
50.5k373142
add a comment |Â
add a comment |Â
up vote
4
down vote
ArrayReshape[first, 4, 4]
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
Also
Module[x = #, x[[All, 0]] = Sequence; x[[All, All, All, 0]] = Sequence; x] &@first
MapAt[Sequence &, first, All, 0, All, All, All, 0]
ReplacePart[first, _, 0 -> Sequence, _, _, _, 0 :> Sequence]
add a comment |Â
up vote
4
down vote
ArrayReshape[first, 4, 4]
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
Also
Module[x = #, x[[All, 0]] = Sequence; x[[All, All, All, 0]] = Sequence; x] &@first
MapAt[Sequence &, first, All, 0, All, All, All, 0]
ReplacePart[first, _, 0 -> Sequence, _, _, _, 0 :> Sequence]
add a comment |Â
up vote
4
down vote
up vote
4
down vote
ArrayReshape[first, 4, 4]
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
Also
Module[x = #, x[[All, 0]] = Sequence; x[[All, All, All, 0]] = Sequence; x] &@first
MapAt[Sequence &, first, All, 0, All, All, All, 0]
ReplacePart[first, _, 0 -> Sequence, _, _, _, 0 :> Sequence]
ArrayReshape[first, 4, 4]
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
Also
Module[x = #, x[[All, 0]] = Sequence; x[[All, All, All, 0]] = Sequence; x] &@first
MapAt[Sequence &, first, All, 0, All, All, All, 0]
ReplacePart[first, _, 0 -> Sequence, _, _, _, 0 :> Sequence]
answered Aug 8 at 6:06
kglr
157k8182379
157k8182379
add a comment |Â
add a comment |Â
up vote
3
down vote
Two approaches I can think of:
Partition[Flatten[first], 4]
Flatten[first, 1, 2, 3, 4]
add a comment |Â
up vote
3
down vote
Two approaches I can think of:
Partition[Flatten[first], 4]
Flatten[first, 1, 2, 3, 4]
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Two approaches I can think of:
Partition[Flatten[first], 4]
Flatten[first, 1, 2, 3, 4]
Two approaches I can think of:
Partition[Flatten[first], 4]
Flatten[first, 1, 2, 3, 4]
answered Aug 8 at 4:50


ΑλÎÂξανδÃÂο Ζεγγ
1,381720
1,381720
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f179669%2fhow-eliminate-in-an-arbitrary-order-in-subgroup-of-a-nested-matrix%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password