level 1
我想算的是
\!\(\*
TagBox[
RowBox[{
RowBox[{"(", "", GridBox[{
{"0"},
{"0"}
},
GridBoxAlignment->{
"Columns" -> {{Center}}, "ColumnsIndexed" -> {},
"Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.7]},
Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
Offset[0.2], {
Offset[0.4]},
Offset[0.2]}, "RowsIndexed" -> {}}], "", ")"}],
RowBox[{"(", GridBox[{
{"0", "1"}
}], ")"}]}],
Function[BoxForm`e$,
MatrixForm[BoxForm`e$]]]\) // MatrixForm
头疼的是他不是
\!\(\*
TagBox[
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"{", "0", "}"}], ",",
RowBox[{"{", "0", "}"}]}], "}"}], ".",
RowBox[{"{",
RowBox[{"{",
RowBox[{"0", ",", "1"}], "}"}], "}"}]}],
Function[BoxForm`e$,
MatrixForm[BoxForm`e$]]]\) // MatrixForm
2020年02月11日 02点02分
2
你第一式没加点,算的是乘法Times。第二式加了点,才是算的Dot
2020年02月12日 04点02分
吧务
level 10
至于你说的“必定自动变成第二种形式”,我没有遇见过。你把能复现这一场景的代码发一下。
2020年02月12日 04点02分
3
刚试了确实那个式子加个点就ok,但是{0, 0} // MatrixForm跟{{0}, {0}}// MatrixForm表现出来是一样的,你可以试试,让他俩分别点乘{{1, 0}},只有第二个可以顺利运算,有个用Dot算的发下面了
2020年02月13日 14点02分
@末世巡航🐷 MatrixForm变成和第二种一样不代表表达式一样啊。参与运算的是表达式又不是MatrixForm产生的GridBox
2020年02月14日 11点02分
@末世巡航🐷 至于为什么外观相同的Box能作为不同含义的表达式参与运算,这个和TagBox有关系(有的地方出现这种情况是因为InterpretationBox)。你目前应该还不适合接触框符这些比较底层的东西,总之如果想少点麻烦,就用{{0},{0}}这种写法就好了,少用那些看着好看的显示样式。
2020年02月14日 11点02分
@末世巡航🐷 TagBox文档里有个类似的例子。你可以看一下。
2020年02月14日 11点02分
level 1
Dot[\!\(\*
TagBox[
RowBox[{"(", "",
TagBox[GridBox[{
{"0"},
{"0"}
},
GridBoxAlignment->{
"Columns" -> {{Center}}, "ColumnsIndexed" -> {},
"Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.5599999999999999]},
Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
Offset[0.2], {
Offset[0.4]},
Offset[0.2]}, "RowsIndexed" -> {}}],
Column], "", ")"}],
Function[BoxForm`e$,
MatrixForm[BoxForm`e$]]]\), ({
{1, 0}
})] // MatrixForm
2020年02月13日 14点02分
4