3
$\begingroup$

I want to output in MatrixForm whenever I have a list/vector/matrix, but I do not want to have to type out the command each time.

How can I write one command at the beginning of the notebook so that all output is so formatted? (Also: generalization to any formatting would be better, with additional specific detail included for this case.)

$\endgroup$
3
$\begingroup$

You can use $Post:

$Post = If[ArrayQ@#, MatrixForm@#, #] &;

enter image description here

$\endgroup$
  • $\begingroup$ Is this what you are after? $\endgroup$ – Kuba Apr 15 '14 at 8:13
  • $\begingroup$ I think that that will do just fine! Thank you! (Could you explain what each part of that code does? Mathematica Documentation can confuse me easily and I like to be able to have multiple sources of explanation for the code.) $\endgroup$ – kevin Apr 16 '14 at 0:55
  • $\begingroup$ @kevin There is not much there, what is that you have problems with? Have you seen $Post? $\endgroup$ – Kuba Apr 16 '14 at 6:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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