I have a nested list like
matrix = {{1.2345664, 2.38673956, 3.567846}, {0.00034554, 124.4554654,
6.34543}, {0.0000233, 244.34454, 2}}
and I want to apply MatrixForm
, but also NumberForm[,{5,4}]
, because I want that in every element of the matrix the numbers are properly padded.
Is this possible in some way?
Interestingly perhaps, I want eventually write the resulting output list in a file.
P.S.: Now I write with Export["my_file.dat",Flatten[matrix]]
, and after I obtain the proper padding using a C program. But there must be a clever way...
MatrixForm[Table[NumberForm[matrix[[i, j]], {5, 4}] , {i, 3}, {j, 3}]]
will do what you want but then you cannot, for instance, takeDet
orInverse
. $\endgroup$Export
(I want to write in append mode so I'm usingPutAppend
). $\endgroup$