2
$\begingroup$

Suppose that $T$ is an array with dimensions

dimensions(T)
{2, 2, m, m}

enter image description here

$\endgroup$

closed as off-topic by MarcoB, Sascha, Feyre, Niki Estner, corey979 Jan 31 '17 at 13:09

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – MarcoB, Sascha, corey979
  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Feyre, Niki Estner
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ For moderators: I'm using a picture instead of latex because I was receiving the error Post appears to contain code that is not properly formatted.... It seems that some of the displayed equations are somehow (mis)interpreted as malformed code (see for instance here). $\endgroup$ – bbn Jan 30 '17 at 16:37
  • $\begingroup$ Can you add code for any attempts you have made at solving this problem? $\endgroup$ – MarcoB Jan 30 '17 at 16:38
  • 2
    $\begingroup$ I think ArrayFlatten will do this, immediately... $\endgroup$ – march Jan 30 '17 at 16:39
  • 3
    $\begingroup$ A minimal example with the large 4D matrix and desired output matrix would help in providing a solution. $\endgroup$ – Jack LaVigne Jan 30 '17 at 17:00
4
$\begingroup$

As @march pointed out in a comment, this is exactly what ArrayFlatten is for. Here's an example:

s = Function[x, Array[Subscript[x, ##] &, {3, 3}]];
t = {{s[a], s[b]}, {s[c], s[d]}};

Dimensions[t]
(* {2,2,3,3} *)

ArrayFlatten[t] // MatrixForm

Output of <code>ArrayFlatten[t]</code> in <code>MatrixForm</code>

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.