1
$\begingroup$

I have the lists in matrix form, as shown in the screenshot fig.2 below. I would like to convert it to pure matrix like fig.1

Edited: For example:

 (\!\(\*
TagBox[GridBox[{
  {
   RowBox[{"{", 
RowBox[{"1", ",", "2", ",", "3"}], "}"}]},
  {
  RowBox[{"{", 
      RowBox[{"4", ",", "5", ",", "6"}], "}"}]},
        {
           RowBox[{"{", 
         RowBox[{"7", ",", "8", ",", "9"}], "}"}]}
        },
        GridBoxAlignment->{
  "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
   "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
     GridBoxSpacings->{"Columns" -> {
         Offset[0.27999999999999997`], {
     Offset[0.5599999999999999]}, 
       Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" 
  -> {
     Offset[0.2], {
   Offset[0.4]}, 
   Offset[0.2]}, "RowsIndexed" -> {}}],
    Column]\))

Fig.1 Figure 1

Fig.2 Figure 2

$\endgroup$
4
  • 3
    $\begingroup$ Remove MatrixForm from fig 2, and just do mat = {list1,list2,....,listn} should do it. But it is better to post the plain text Mathematica code you used to generate this. $\endgroup$
    – Nasser
    Jun 21 at 19:39
  • 7
    $\begingroup$ Without something other users can copy to their Mathematica session, we can't help you. $\endgroup$ Jun 21 at 19:40
  • $\begingroup$ I edited the question, thanks! $\endgroup$
    – Vô Danh
    Jun 21 at 20:34
  • 2
    $\begingroup$ As already suggested, just remove MatrixForm from the code that created your expression in the question. If, however, all you have is that expression, copy it into an In line and execute it. $\endgroup$
    – bbgodfrey
    Jun 21 at 22:24

1 Answer 1

3
$\begingroup$
Clear["Global`*"]

(mat = RandomInteger[200, {3, 3}]) // MatrixForm

enter image description here

Note that the MatrixForm wrapper is isolated from the definition of the matrix mat by the parentheses. This facilitates subsequent calculations with the matrix.

Tr@mat === Simplify@Total@Eigenvalues@mat

(* True *)
$\endgroup$

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