Using good method to produce a regular matrixHow to turn a random graph into a matrixHow can I fit a matrix...
What defenses are there against being summoned by the Gate spell?
Why do falling prices hurt debtors?
Font hinting is lost in Chrome-like browsers (for some languages )
Do I have a twin with permutated remainders?
How could an uplifted falcon's brain work?
How to write a macro that is braces sensitive?
Modeling an IPv4 Address
tikz: show 0 at the axis origin
Why can't I see bouncing of a switch on an oscilloscope?
What does it mean to describe someone as a butt steak?
What are these boxed doors outside store fronts in New York?
LaTeX closing $ signs makes cursor jump
Is it possible to do 50 km distance without any previous training?
Smoothness of finite-dimensional functional calculus
What does "Puller Prush Person" mean?
Why dont electromagnetic waves interact with each other?
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
Mage Armor with Defense fighting style (for Adventurers League bladeslinger)
How much RAM could one put in a typical 80386 setup?
Has the BBC provided arguments for saying Brexit being cancelled is unlikely?
How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?
Today is the Center
Arthur Somervell: 1000 Exercises - Meaning of this notation
Languages that we cannot (dis)prove to be Context-Free
Using good method to produce a regular matrix
How to turn a random graph into a matrixHow can I fit a matrix function with multiple variables to given eigenvalues?What is the best way to produce a symmetric semi-definite matrix using as few variables as possible?Produce a 1-dimensional list of all unique matrix elements'MatrixForm' problemA problem about matrix/vector extension via $tt ArrayPad$Integral approximation using a matrix operatorUsing ZeroTest method with RowReduceDAE Jacobian matrix StiffnessSwitching alternativeHow to write a matrix of $ntimes 2$ where the first column is made of only 1's?
$begingroup$
The matrixform is as follow, and how can I use good method to produce it?
matrix
New contributor
$endgroup$
|
show 4 more comments
$begingroup$
The matrixform is as follow, and how can I use good method to produce it?
matrix
New contributor
$endgroup$
$begingroup$
If the picture can't show,then here is the matrixform:H={{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
$endgroup$
– KarryMa
17 hours ago
$begingroup$
KroneckerProduct[ MapThread[ ReplacePart[#1, #2 -> 0] &, {ConstantArray[1, {3, 3}], RotateRight[Range[3]]}], {{1}, {2}} ]
$endgroup$
– Henrik Schumacher
16 hours ago
$begingroup$
Great,thank you very much!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
OrNormal@KroneckerProduct[ SparseArray[{Band[{1, 1}] -> 1, Band[{1, 2}] -> 1, Band[{3, 1}] -> 1}, {3, 3}], {{1}, {2}} ]
.
$endgroup$
– Henrik Schumacher
16 hours ago
3
$begingroup$
Transpose@KroneckerProduct[Permutations[{1, 0, 1}], {1, 2}]
$endgroup$
– LouisB
16 hours ago
|
show 4 more comments
$begingroup$
The matrixform is as follow, and how can I use good method to produce it?
matrix
New contributor
$endgroup$
The matrixform is as follow, and how can I use good method to produce it?
matrix
matrix
New contributor
New contributor
New contributor
asked 17 hours ago
KarryMaKarryMa
112
112
New contributor
New contributor
$begingroup$
If the picture can't show,then here is the matrixform:H={{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
$endgroup$
– KarryMa
17 hours ago
$begingroup$
KroneckerProduct[ MapThread[ ReplacePart[#1, #2 -> 0] &, {ConstantArray[1, {3, 3}], RotateRight[Range[3]]}], {{1}, {2}} ]
$endgroup$
– Henrik Schumacher
16 hours ago
$begingroup$
Great,thank you very much!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
OrNormal@KroneckerProduct[ SparseArray[{Band[{1, 1}] -> 1, Band[{1, 2}] -> 1, Band[{3, 1}] -> 1}, {3, 3}], {{1}, {2}} ]
.
$endgroup$
– Henrik Schumacher
16 hours ago
3
$begingroup$
Transpose@KroneckerProduct[Permutations[{1, 0, 1}], {1, 2}]
$endgroup$
– LouisB
16 hours ago
|
show 4 more comments
$begingroup$
If the picture can't show,then here is the matrixform:H={{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
$endgroup$
– KarryMa
17 hours ago
$begingroup$
KroneckerProduct[ MapThread[ ReplacePart[#1, #2 -> 0] &, {ConstantArray[1, {3, 3}], RotateRight[Range[3]]}], {{1}, {2}} ]
$endgroup$
– Henrik Schumacher
16 hours ago
$begingroup$
Great,thank you very much!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
OrNormal@KroneckerProduct[ SparseArray[{Band[{1, 1}] -> 1, Band[{1, 2}] -> 1, Band[{3, 1}] -> 1}, {3, 3}], {{1}, {2}} ]
.
$endgroup$
– Henrik Schumacher
16 hours ago
3
$begingroup$
Transpose@KroneckerProduct[Permutations[{1, 0, 1}], {1, 2}]
$endgroup$
– LouisB
16 hours ago
$begingroup$
If the picture can't show,then here is the matrixform:H={{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
$endgroup$
– KarryMa
17 hours ago
$begingroup$
If the picture can't show,then here is the matrixform:H={{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
$endgroup$
– KarryMa
17 hours ago
$begingroup$
KroneckerProduct[ MapThread[ ReplacePart[#1, #2 -> 0] &, {ConstantArray[1, {3, 3}], RotateRight[Range[3]]}], {{1}, {2}} ]
$endgroup$
– Henrik Schumacher
16 hours ago
$begingroup$
KroneckerProduct[ MapThread[ ReplacePart[#1, #2 -> 0] &, {ConstantArray[1, {3, 3}], RotateRight[Range[3]]}], {{1}, {2}} ]
$endgroup$
– Henrik Schumacher
16 hours ago
$begingroup$
Great,thank you very much!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
Great,thank you very much!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
Or
Normal@KroneckerProduct[ SparseArray[{Band[{1, 1}] -> 1, Band[{1, 2}] -> 1, Band[{3, 1}] -> 1}, {3, 3}], {{1}, {2}} ]
.$endgroup$
– Henrik Schumacher
16 hours ago
$begingroup$
Or
Normal@KroneckerProduct[ SparseArray[{Band[{1, 1}] -> 1, Band[{1, 2}] -> 1, Band[{3, 1}] -> 1}, {3, 3}], {{1}, {2}} ]
.$endgroup$
– Henrik Schumacher
16 hours ago
3
3
$begingroup$
Transpose@KroneckerProduct[Permutations[{1, 0, 1}], {1, 2}]
$endgroup$
– LouisB
16 hours ago
$begingroup$
Transpose@KroneckerProduct[Permutations[{1, 0, 1}], {1, 2}]
$endgroup$
– LouisB
16 hours ago
|
show 4 more comments
2 Answers
2
active
oldest
votes
$begingroup$
IntegerDigits[{12,24,4,8,10,20},3,3]
{{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
also..
s = Transpose[Permutations /@ {{1, 1, 0}, {2, 2, 0}}];
Flatten[{{s[[1]]},Reverse@Rest@s},2]
{{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
$endgroup$
2
$begingroup$
I like the answer,thanks!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
@KarryMa Alternatively toPadLeft
you can add3
as 3rd argumentIntegerDigits[{12, 24, 4, 8, 10, 20}, 3, 3]
.
$endgroup$
– Coolwater
11 hours ago
$begingroup$
yes, you are so right!
$endgroup$
– J42161217
11 hours ago
add a comment |
$begingroup$
A nice tool for this job is ArrayFlatten[ ]
a = {{1}, {2}}
$left(
begin{array}{c}
1 \
2 \
end{array}
right)$
Not sure why your rows are ordered the way they are. Are you trying to have a non-zero diagonal?
{{a,a,0},{0,a,a},{a,0,a}}// ArrayFlatten
$left(
begin{array}{ccc}
1 & 1 & 0 \
2 & 2 & 0 \
0 & 1 & 1 \
0 & 2 & 2 \
1 & 0 & 1 \
2 & 0 & 2 \
end{array}
right)$
$endgroup$
$begingroup$
This is not the exact result the OP is asking. The order of the elements is different. Also the "permutation" solution is already posted in my answer
$endgroup$
– J42161217
11 hours ago
$begingroup$
My purpose was to introduceArrayFlatten
. Not enough info to algorithmically determine the order of perms.
$endgroup$
– MikeY
10 hours ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
KarryMa is a new contributor. Be nice, and check out our Code of Conduct.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f194717%2fusing-good-method-to-produce-a-regular-matrix%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
IntegerDigits[{12,24,4,8,10,20},3,3]
{{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
also..
s = Transpose[Permutations /@ {{1, 1, 0}, {2, 2, 0}}];
Flatten[{{s[[1]]},Reverse@Rest@s},2]
{{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
$endgroup$
2
$begingroup$
I like the answer,thanks!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
@KarryMa Alternatively toPadLeft
you can add3
as 3rd argumentIntegerDigits[{12, 24, 4, 8, 10, 20}, 3, 3]
.
$endgroup$
– Coolwater
11 hours ago
$begingroup$
yes, you are so right!
$endgroup$
– J42161217
11 hours ago
add a comment |
$begingroup$
IntegerDigits[{12,24,4,8,10,20},3,3]
{{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
also..
s = Transpose[Permutations /@ {{1, 1, 0}, {2, 2, 0}}];
Flatten[{{s[[1]]},Reverse@Rest@s},2]
{{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
$endgroup$
2
$begingroup$
I like the answer,thanks!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
@KarryMa Alternatively toPadLeft
you can add3
as 3rd argumentIntegerDigits[{12, 24, 4, 8, 10, 20}, 3, 3]
.
$endgroup$
– Coolwater
11 hours ago
$begingroup$
yes, you are so right!
$endgroup$
– J42161217
11 hours ago
add a comment |
$begingroup$
IntegerDigits[{12,24,4,8,10,20},3,3]
{{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
also..
s = Transpose[Permutations /@ {{1, 1, 0}, {2, 2, 0}}];
Flatten[{{s[[1]]},Reverse@Rest@s},2]
{{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
$endgroup$
IntegerDigits[{12,24,4,8,10,20},3,3]
{{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
also..
s = Transpose[Permutations /@ {{1, 1, 0}, {2, 2, 0}}];
Flatten[{{s[[1]]},Reverse@Rest@s},2]
{{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
edited 11 hours ago
answered 16 hours ago
J42161217J42161217
4,248324
4,248324
2
$begingroup$
I like the answer,thanks!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
@KarryMa Alternatively toPadLeft
you can add3
as 3rd argumentIntegerDigits[{12, 24, 4, 8, 10, 20}, 3, 3]
.
$endgroup$
– Coolwater
11 hours ago
$begingroup$
yes, you are so right!
$endgroup$
– J42161217
11 hours ago
add a comment |
2
$begingroup$
I like the answer,thanks!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
@KarryMa Alternatively toPadLeft
you can add3
as 3rd argumentIntegerDigits[{12, 24, 4, 8, 10, 20}, 3, 3]
.
$endgroup$
– Coolwater
11 hours ago
$begingroup$
yes, you are so right!
$endgroup$
– J42161217
11 hours ago
2
2
$begingroup$
I like the answer,thanks!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
I like the answer,thanks!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
@KarryMa Alternatively to
PadLeft
you can add 3
as 3rd argument IntegerDigits[{12, 24, 4, 8, 10, 20}, 3, 3]
.$endgroup$
– Coolwater
11 hours ago
$begingroup$
@KarryMa Alternatively to
PadLeft
you can add 3
as 3rd argument IntegerDigits[{12, 24, 4, 8, 10, 20}, 3, 3]
.$endgroup$
– Coolwater
11 hours ago
$begingroup$
yes, you are so right!
$endgroup$
– J42161217
11 hours ago
$begingroup$
yes, you are so right!
$endgroup$
– J42161217
11 hours ago
add a comment |
$begingroup$
A nice tool for this job is ArrayFlatten[ ]
a = {{1}, {2}}
$left(
begin{array}{c}
1 \
2 \
end{array}
right)$
Not sure why your rows are ordered the way they are. Are you trying to have a non-zero diagonal?
{{a,a,0},{0,a,a},{a,0,a}}// ArrayFlatten
$left(
begin{array}{ccc}
1 & 1 & 0 \
2 & 2 & 0 \
0 & 1 & 1 \
0 & 2 & 2 \
1 & 0 & 1 \
2 & 0 & 2 \
end{array}
right)$
$endgroup$
$begingroup$
This is not the exact result the OP is asking. The order of the elements is different. Also the "permutation" solution is already posted in my answer
$endgroup$
– J42161217
11 hours ago
$begingroup$
My purpose was to introduceArrayFlatten
. Not enough info to algorithmically determine the order of perms.
$endgroup$
– MikeY
10 hours ago
add a comment |
$begingroup$
A nice tool for this job is ArrayFlatten[ ]
a = {{1}, {2}}
$left(
begin{array}{c}
1 \
2 \
end{array}
right)$
Not sure why your rows are ordered the way they are. Are you trying to have a non-zero diagonal?
{{a,a,0},{0,a,a},{a,0,a}}// ArrayFlatten
$left(
begin{array}{ccc}
1 & 1 & 0 \
2 & 2 & 0 \
0 & 1 & 1 \
0 & 2 & 2 \
1 & 0 & 1 \
2 & 0 & 2 \
end{array}
right)$
$endgroup$
$begingroup$
This is not the exact result the OP is asking. The order of the elements is different. Also the "permutation" solution is already posted in my answer
$endgroup$
– J42161217
11 hours ago
$begingroup$
My purpose was to introduceArrayFlatten
. Not enough info to algorithmically determine the order of perms.
$endgroup$
– MikeY
10 hours ago
add a comment |
$begingroup$
A nice tool for this job is ArrayFlatten[ ]
a = {{1}, {2}}
$left(
begin{array}{c}
1 \
2 \
end{array}
right)$
Not sure why your rows are ordered the way they are. Are you trying to have a non-zero diagonal?
{{a,a,0},{0,a,a},{a,0,a}}// ArrayFlatten
$left(
begin{array}{ccc}
1 & 1 & 0 \
2 & 2 & 0 \
0 & 1 & 1 \
0 & 2 & 2 \
1 & 0 & 1 \
2 & 0 & 2 \
end{array}
right)$
$endgroup$
A nice tool for this job is ArrayFlatten[ ]
a = {{1}, {2}}
$left(
begin{array}{c}
1 \
2 \
end{array}
right)$
Not sure why your rows are ordered the way they are. Are you trying to have a non-zero diagonal?
{{a,a,0},{0,a,a},{a,0,a}}// ArrayFlatten
$left(
begin{array}{ccc}
1 & 1 & 0 \
2 & 2 & 0 \
0 & 1 & 1 \
0 & 2 & 2 \
1 & 0 & 1 \
2 & 0 & 2 \
end{array}
right)$
edited 10 hours ago
answered 13 hours ago
MikeYMikeY
3,768916
3,768916
$begingroup$
This is not the exact result the OP is asking. The order of the elements is different. Also the "permutation" solution is already posted in my answer
$endgroup$
– J42161217
11 hours ago
$begingroup$
My purpose was to introduceArrayFlatten
. Not enough info to algorithmically determine the order of perms.
$endgroup$
– MikeY
10 hours ago
add a comment |
$begingroup$
This is not the exact result the OP is asking. The order of the elements is different. Also the "permutation" solution is already posted in my answer
$endgroup$
– J42161217
11 hours ago
$begingroup$
My purpose was to introduceArrayFlatten
. Not enough info to algorithmically determine the order of perms.
$endgroup$
– MikeY
10 hours ago
$begingroup$
This is not the exact result the OP is asking. The order of the elements is different. Also the "permutation" solution is already posted in my answer
$endgroup$
– J42161217
11 hours ago
$begingroup$
This is not the exact result the OP is asking. The order of the elements is different. Also the "permutation" solution is already posted in my answer
$endgroup$
– J42161217
11 hours ago
$begingroup$
My purpose was to introduce
ArrayFlatten
. Not enough info to algorithmically determine the order of perms.$endgroup$
– MikeY
10 hours ago
$begingroup$
My purpose was to introduce
ArrayFlatten
. Not enough info to algorithmically determine the order of perms.$endgroup$
– MikeY
10 hours ago
add a comment |
KarryMa is a new contributor. Be nice, and check out our Code of Conduct.
KarryMa is a new contributor. Be nice, and check out our Code of Conduct.
KarryMa is a new contributor. Be nice, and check out our Code of Conduct.
KarryMa is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f194717%2fusing-good-method-to-produce-a-regular-matrix%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
If the picture can't show,then here is the matrixform:H={{1,1,0},{2,2,0},{0,1,1},{0,2,2},{1,0,1},{2,0,2}}
$endgroup$
– KarryMa
17 hours ago
$begingroup$
KroneckerProduct[ MapThread[ ReplacePart[#1, #2 -> 0] &, {ConstantArray[1, {3, 3}], RotateRight[Range[3]]}], {{1}, {2}} ]
$endgroup$
– Henrik Schumacher
16 hours ago
$begingroup$
Great,thank you very much!
$endgroup$
– KarryMa
16 hours ago
$begingroup$
Or
Normal@KroneckerProduct[ SparseArray[{Band[{1, 1}] -> 1, Band[{1, 2}] -> 1, Band[{3, 1}] -> 1}, {3, 3}], {{1}, {2}} ]
.$endgroup$
– Henrik Schumacher
16 hours ago
3
$begingroup$
Transpose@KroneckerProduct[Permutations[{1, 0, 1}], {1, 2}]
$endgroup$
– LouisB
16 hours ago