Skip to content

Instantly share code, notes, and snippets.

@Gravifer
Last active March 18, 2021 14:43
Show Gist options
  • Save Gravifer/43fcd678d0c5bcb24d5578112dbd56f8 to your computer and use it in GitHub Desktop.
Save Gravifer/43fcd678d0c5bcb24d5578112dbd56f8 to your computer and use it in GitHub Desktop.
Mathematica one-liners

Mathematica one-liners

  • Visualize a block matrix mat
    MatrixForm[{Grid[Map[Grid, mat, {2}], Dividers -> Center]}]

performance notes

  • In prototyping, you may use something like
    expr[#]&/@list
    where expr[#] merely stands for an expression containing #. If you don't need the pure function expr[#]& else where, you may rewrite this as
    Table[expr[elem], {elem, list}]
    This will remove an overhead from pure function calling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment