Skip to content

Instantly share code, notes, and snippets.

@givens
Created December 14, 2012 16:28
Show Gist options
  • Save givens/4286691 to your computer and use it in GitHub Desktop.
Save givens/4286691 to your computer and use it in GitHub Desktop.
Mathematica RESHAPE array command
Reshape[list_, dimensions_] :=
First[Fold[Partition[#1, #2] &, Flatten[list], Reverse[dimensions]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment