Wolfram mathematica Mathematica中展平的逆?
f[x_3;]的倒数是什么:=展平[x],其中x是具有尺寸DIM的数组?您可能需要分区[]或其相关项。没有内置函数,但将和组合在一起非常容易:Wolfram mathematica Mathematica中展平的逆?,wolfram-mathematica,Wolfram Mathematica,f[x_3;]的倒数是什么:=展平[x],其中x是具有尺寸DIM的数组?您可能需要分区[]或其相关项。没有内置函数,但将和组合在一起非常容易: In[47]:= x1 = RandomReal[{0, 1}, {3, 4, 5}]; In[48]:= dims = Dimensions[x1] Out[48]= {3, 4, 5} In[49]:= x2 = Fold[Partition, Flatten[x1], Most[Reverse[dims]]]; In[50]:= x1 ==
In[47]:= x1 = RandomReal[{0, 1}, {3, 4, 5}];
In[48]:= dims = Dimensions[x1]
Out[48]= {3, 4, 5}
In[49]:= x2 = Fold[Partition, Flatten[x1], Most[Reverse[dims]]];
In[50]:= x1 == x2
Out[50]= True