6
$\begingroup$

If I input a giant matrix in Mathematica, and it is contained in a cell, is there a way to contract it so that it uses up significantly less space in the notebook?

$\endgroup$
9
  • $\begingroup$ If I understand you right, you can always put ";" at the end so it does not display (i.e. make an OUT cell). Otherwise look at Short command which will display a small version of the input. $\endgroup$
    – Nasser
    Oct 21 at 11:02
  • 1
    $\begingroup$ ... Ofcourse, you can always turn off the Open property of the Input CELL also. $\endgroup$
    – Nasser
    Oct 21 at 11:08
  • $\begingroup$ How about just fold the cell? Group the cells and fold the group. $\endgroup$
    – rnotlnglgq
    Oct 21 at 11:08
  • $\begingroup$ Also look at Shallow and Skeleton commands. $\endgroup$
    – Syed
    Oct 21 at 11:10
  • 5
    $\begingroup$ Iconize might be what you're looking for! $\endgroup$
    – Carl Lange
    Oct 21 at 11:13
10
$\begingroup$

From comments, these are the two options

Use cell/open/close

enter image description here

Use Iconize, as suggested by Carl Lange, which I think is a better option, since you still see the LHS of the assignment and so know what is one that cell, as compared to open/close the cell, where you'd have to open the cell again to see what is there.

enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ You can also call Iconize in code with a second argument to give the pill a label, FYI! $\endgroup$
    – Carl Lange
    Oct 21 at 12:53
  • 4
    $\begingroup$ I also like the iconize option much better. Also, you can iconize just a portion of the matrix. This might not be so interesting for matrices, but it's very interesting for other inputs. For example, a Plot command that has its function and range in the open, but a sequence of messy options iconized. $\endgroup$
    – John Fultz
    Oct 21 at 15:45

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.