Q: need to display the subx table as shown, with no decimal points or {} and with some spaces between columns. Some entries will be nonzero and it would be nice to show them in boldface. I tried Style with Positive but didn't succeed. This method works but there must be a better way.
circorr = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 6, 0}, {0, 0, 0, 8, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}
Ans:
1. Map[If[# != 0, Style[#, Bold], 0] &, circorr, {2}] // MatrixForm
2. circorr /. x_?Positive :> Style[x, Bold] // MatrixForm
讀者回應 ( 0 意見 )
訂閱發佈留言 (Atom)
發佈留言
Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.
如果這篇文章對你有幫助,那請留個訊息給我~